git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit c369709837d3b46f11f96b69f996371d77256e62

clean undefined code state

wanderer committed on 7/21/2017, 6:55:43 PM
Parent: aebb51fa47b38ca825a49a00b5a83afca13ba3e3

Files changed

index.jschanged
tests/index.jschanged
index.jsView
@@ -107,14 +107,13 @@
107107 // create a lock to prevent the scheduler from reloving waits before the
108108 // new container is loaded
109109 const resolve = this.scheduler.getLock(id)
110110 const idHash = await this._getHashFromObj(id)
111- const code = message.data.byteLength ? message.data : undefined
111+ // const code = message.data.byteLength ? message.data : undefined
112112 const state = {
113113 nonce: [0],
114114 ports: {},
115- type: type,
116- code: code
115+ type: type
117116 }
118117
119118 // save the container in the state
120119 await this.graph.set(this.state, idHash, state)
tests/index.jsView
@@ -12,8 +12,9 @@
1212 this.kernel = kernel
1313 }
1414
1515 initialize (message) {
16+ this.kernel.state.code = message.data.byteLength ? message.data : undefined
1617 const port = message.ports[0]
1718 if (port) {
1819 this.kernel.ports.bind('root', port)
1920 }
@@ -62,9 +63,9 @@
6263
6364 tape('basic - do not store containers with no ports bound', async t => {
6465 t.plan(1)
6566 const expectedState = {
66- '/': 'zdpuAx5LRRwTgzPipKEPgh7MHUKu4Pd1BYjDqBcf9whgzvrqf'
67+ '/': 'zdpuAozDi6tKPbqmHJxo7aNES2xVt1MkaCLyxcioEKzz3M2WH'
6768 }
6869
6970 class testVMContainer extends BaseContainer {
7071 initialize () {}

Built with git-ssb-web