git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 3c2fa2713562134ea6eec3a5224a1d71c7fec6da

use onInitalize

Signed-off-by: wanderer <mjbecze@gmail.com>
wanderer committed on 7/28/2017, 2:55:32 AM
Parent: 594efad3e6f4fb8105d5f177d77ec89c2ecd2c09

Files changed

kernel.jschanged
tests/index.jschanged
kernel.jsView
@@ -40,9 +40,9 @@
4040 return this._startMessageLoop()
4141 }
4242
4343 async initialize (message) {
44- await this.run(message, 'initialize')
44+ await this.run(message, 'onInitialize')
4545 return this._startMessageLoop()
4646 }
4747
4848 // waits for the next message
tests/index.jsView
@@ -9,9 +9,9 @@
99 start: false
1010 })
1111
1212 class BaseContainer extends AbstractContainer {
13- initialize (message) {
13+ onInitialize (message) {
1414 this.kernel.state.code = message.data.byteLength ? message.data : undefined
1515 const port = message.ports[0]
1616 if (port) {
1717 this.kernel.ports.bind('root', port)
@@ -61,9 +61,9 @@
6161 '/': 'zdpuAozDi6tKPbqmHJxo7aNES2xVt1MkaCLyxcioEKzz3M2WH'
6262 }
6363
6464 class testVMContainer extends BaseContainer {
65- initialize () {}
65+ onInitialize () {}
6666 }
6767
6868 const hypervisor = new Hypervisor(node.dag)
6969 hypervisor.registerContainer('test', testVMContainer)
@@ -506,9 +506,9 @@
506506 }
507507 }
508508
509509 class Waiter extends BaseContainer {
510- initialize () {
510+ onInitialize () {
511511 return new Promise((resolve, reject) => {
512512 setTimeout(() => {
513513 resolve()
514514 }, 200)
@@ -873,9 +873,9 @@
873873 }
874874 }
875875
876876 class Sub extends BaseContainer {
877- initailize (message) {
877+ onInitailize (message) {
878878 this.kernel.ports.bind('root', message.ports[0])
879879 const [portRef1, portRef2] = root.ports.createChannel()
880880 root.ports.bind('child', portRef1)
881881 root.createInstance('root', root.createMessage({

Built with git-ssb-web