git ssb

0+

wanderer🌟 / js-primea-wasm-container



Commit 7b38bf7ebbc27a6b04424d7feeb21dc16d76fbbb

update all deps

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 11/26/2017, 2:17:46 AM
Parent: 6731ea092f0166164cf1bbc8653439f46a7f6bd6

Files changed

index.jschanged
package-lock.jsonchanged
package.jsonchanged
tests/index.jschanged
index.jsView
@@ -4,21 +4,20 @@
44
55 module.exports = class WasmContainer extends AbstractContainer {
66 /**
77 * The wasm container runs wasm code and provides a basic API for wasm
8- * interfaces for interacting with the kernel
9- * @param {object} kernel - the kernel instance
8 + * interfaces for interacting with the actor
9 + * @param {object} actor - the actor instance
1010 * @param {object} interfaces - a map of interfaces to expose to the wasm binary
1111 */
12- constructor (kernel, interfaces) {
13- super()
14- this.kernel = kernel
12 + constructor (actor, interfaces) {
13 + super(actor)
1514 this.imports = interfaces
1615 this.referanceMap = new ReferanceMap()
1716 }
1817
1918 async onCreation (message) {
20- let code = this.kernel.code
19 + let code = this.actor.code
2120 if (!WebAssembly.validate(code)) {
2221 throw new Error('invalid wasm binary')
2322 } else {
2423 for (const name in this.imports) {
@@ -26,9 +25,9 @@
2625 if (interf.initialize) {
2726 code = await interf.initialize(code)
2827 }
2928 }
30- this.kernel.state.code = code
29 + this.actor.state.code = code
3130 }
3231 return this._run(message, 'onCreation')
3332 }
3433
@@ -57,9 +56,9 @@
5756 }
5857 }
5958 }
6059
61- const result = await WebAssembly.instantiate(this.kernel.code, importMap)
60 + const result = await WebAssembly.instantiate(this.actor.code, importMap)
6261 this.instance = result.instance
6362
6463 // add the message and ports to the refereance map
6564 const messageRef = this.referanceMap.add(message)
package-lock.jsonView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 182884 bytes
New file size: 183230 bytes
package.jsonView
@@ -25,10 +25,10 @@
2525 "dfinity-radix-tree": "0.0.4",
2626 "coveralls": "^3.0.0",
2727 "level": "^2.0.0",
2828 "nyc": "^11.2.1",
29- "primea-hypervisor": "0.4.0",
30- "primea-message": "0.0.4",
29 + "primea-hypervisor": "^0.4.1",
30 + "primea-message": "^0.5.0",
3131 "standard": "^10.0.0",
3232 "tape": "^4.6.3",
3333 "wast2wasm": "0.0.1"
3434 },
tests/index.jsView
@@ -128,9 +128,8 @@
128128 data: Buffer.from([0])
129129 })
130130
131131 message.on('execution:error', (e) => {
132- console.log(e)
133132 t.pass('should cature error')
134133 })
135134
136135 await hypervisor.createActor(WasmContainer.typeId, message)

Built with git-ssb-web