Commit 251a0f837a762cf942d5254502a65129e1a09e0b
fix execute
wanderer committed on 1/3/2018, 1:39:37 AMParent: 9ac8199735a18aefe68064804f312acd02018d0d
Files changed
index.js | changed |
index.js | ||
---|---|---|
@@ -2,9 +2,9 @@ | ||
2 | 2 | const AbstractContainer = require('primea-abstract-container') |
3 | 3 | const ContainerTable = require('primea-container-table') |
4 | 4 | const RadixTree = require('dfinity-radix-tree') |
5 | 5 | |
6 | -const CODEKEY = new RadixTree.ArrayConstructor([1]) | |
6 | +const CODEKEY = new RadixTree.ArrayConstructor([0, 1]) | |
7 | 7 | |
8 | 8 | module.exports = class WasmContainer extends AbstractContainer { |
9 | 9 | /** |
10 | 10 | * The wasm container runs wasm code and provides a basic API for wasm |
@@ -99,10 +99,12 @@ | ||
99 | 99 | * executes a callback given an index in the exported callback container |
100 | 100 | * @param {integer} cb |
101 | 101 | * @param {*} val - a value to return to the callback function |
102 | 102 | */ |
103 | - execute (cb, val) { | |
104 | - this.instance.exports.callbacks.get(cb)(val) | |
103 | + execute (cb) { | |
104 | + const args = [...arguments] | |
105 | + args.shift() | |
106 | + this.instance.exports.callbacks.get(cb)(...args) | |
105 | 107 | } |
106 | 108 | |
107 | 109 | /** |
108 | 110 | * returns a section of memory from the wasm instance |
Built with git-ssb-web