Commit c369709837d3b46f11f96b69f996371d77256e62
clean undefined code state
wanderer committed on 7/21/2017, 6:55:43 PMParent: aebb51fa47b38ca825a49a00b5a83afca13ba3e3
Files changed
index.js | changed |
tests/index.js | changed |
index.js | ||
---|---|---|
@@ -107,14 +107,13 @@ | ||
107 | 107 | // create a lock to prevent the scheduler from reloving waits before the |
108 | 108 | // new container is loaded |
109 | 109 | const resolve = this.scheduler.getLock(id) |
110 | 110 | const idHash = await this._getHashFromObj(id) |
111 | - const code = message.data.byteLength ? message.data : undefined | |
111 | + // const code = message.data.byteLength ? message.data : undefined | |
112 | 112 | const state = { |
113 | 113 | nonce: [0], |
114 | 114 | ports: {}, |
115 | - type: type, | |
116 | - code: code | |
115 | + type: type | |
117 | 116 | } |
118 | 117 | |
119 | 118 | // save the container in the state |
120 | 119 | await this.graph.set(this.state, idHash, state) |
tests/index.js | ||
---|---|---|
@@ -12,8 +12,9 @@ | ||
12 | 12 | this.kernel = kernel |
13 | 13 | } |
14 | 14 | |
15 | 15 | initialize (message) { |
16 | + this.kernel.state.code = message.data.byteLength ? message.data : undefined | |
16 | 17 | const port = message.ports[0] |
17 | 18 | if (port) { |
18 | 19 | this.kernel.ports.bind('root', port) |
19 | 20 | } |
@@ -62,9 +63,9 @@ | ||
62 | 63 | |
63 | 64 | tape('basic - do not store containers with no ports bound', async t => { |
64 | 65 | t.plan(1) |
65 | 66 | const expectedState = { |
66 | - '/': 'zdpuAx5LRRwTgzPipKEPgh7MHUKu4Pd1BYjDqBcf9whgzvrqf' | |
67 | + '/': 'zdpuAozDi6tKPbqmHJxo7aNES2xVt1MkaCLyxcioEKzz3M2WH' | |
67 | 68 | } |
68 | 69 | |
69 | 70 | class testVMContainer extends BaseContainer { |
70 | 71 | initialize () {} |
Built with git-ssb-web