git ssb

0+

wanderer🌟 / js-primea-wasm-container



Commit 251a0f837a762cf942d5254502a65129e1a09e0b

fix execute

wanderer committed on 1/3/2018, 1:39:37 AM
Parent: 9ac8199735a18aefe68064804f312acd02018d0d

Files changed

index.jschanged
index.jsView
@@ -2,9 +2,9 @@
22 const AbstractContainer = require('primea-abstract-container')
33 const ContainerTable = require('primea-container-table')
44 const RadixTree = require('dfinity-radix-tree')
55
6-const CODEKEY = new RadixTree.ArrayConstructor([1])
6+const CODEKEY = new RadixTree.ArrayConstructor([0, 1])
77
88 module.exports = class WasmContainer extends AbstractContainer {
99 /**
1010 * The wasm container runs wasm code and provides a basic API for wasm
@@ -99,10 +99,12 @@
9999 * executes a callback given an index in the exported callback container
100100 * @param {integer} cb
101101 * @param {*} val - a value to return to the callback function
102102 */
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)
105107 }
106108
107109 /**
108110 * returns a section of memory from the wasm instance

Built with git-ssb-web