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.js | changed |
package-lock.json | changed |
package.json | changed |
tests/index.js | changed |
index.js | ||
---|---|---|
@@ -4,21 +4,20 @@ | ||
4 | 4 … | |
5 | 5 … | module.exports = class WasmContainer extends AbstractContainer { |
6 | 6 … | /** |
7 | 7 … | * 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 | |
10 | 10 … | * @param {object} interfaces - a map of interfaces to expose to the wasm binary |
11 | 11 … | */ |
12 | - constructor (kernel, interfaces) { | |
13 | - super() | |
14 | - this.kernel = kernel | |
12 … | + constructor (actor, interfaces) { | |
13 … | + super(actor) | |
15 | 14 … | this.imports = interfaces |
16 | 15 … | this.referanceMap = new ReferanceMap() |
17 | 16 … | } |
18 | 17 … | |
19 | 18 … | async onCreation (message) { |
20 | - let code = this.kernel.code | |
19 … | + let code = this.actor.code | |
21 | 20 … | if (!WebAssembly.validate(code)) { |
22 | 21 … | throw new Error('invalid wasm binary') |
23 | 22 … | } else { |
24 | 23 … | for (const name in this.imports) { |
@@ -26,9 +25,9 @@ | ||
26 | 25 … | if (interf.initialize) { |
27 | 26 … | code = await interf.initialize(code) |
28 | 27 … | } |
29 | 28 … | } |
30 | - this.kernel.state.code = code | |
29 … | + this.actor.state.code = code | |
31 | 30 … | } |
32 | 31 … | return this._run(message, 'onCreation') |
33 | 32 … | } |
34 | 33 … | |
@@ -57,9 +56,9 @@ | ||
57 | 56 … | } |
58 | 57 … | } |
59 | 58 … | } |
60 | 59 … | |
61 | - const result = await WebAssembly.instantiate(this.kernel.code, importMap) | |
60 … | + const result = await WebAssembly.instantiate(this.actor.code, importMap) | |
62 | 61 … | this.instance = result.instance |
63 | 62 … | |
64 | 63 … | // add the message and ports to the refereance map |
65 | 64 … | const messageRef = this.referanceMap.add(message) |
package-lock.json | ||
---|---|---|
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.json | ||
---|---|---|
@@ -25,10 +25,10 @@ | ||
25 | 25 … | "dfinity-radix-tree": "0.0.4", |
26 | 26 … | "coveralls": "^3.0.0", |
27 | 27 … | "level": "^2.0.0", |
28 | 28 … | "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", | |
31 | 31 … | "standard": "^10.0.0", |
32 | 32 … | "tape": "^4.6.3", |
33 | 33 … | "wast2wasm": "0.0.1" |
34 | 34 … | }, |
Built with git-ssb-web