Commit 166a2a7fe7dd1d0ea974d47141f718a203324a31
clean up
wanderer committed on 7/3/2017, 4:59:30 PMParent: 679caf4c89ce01c38751eb18177edee3a845d23e
Files changed
kernel.js | changed |
kernel.js | ||
---|---|---|
@@ -41,9 +41,9 @@ | ||
41 | 41 | } |
42 | 42 | |
43 | 43 | initialize (message) { |
44 | 44 | this.containerState = 'running' |
45 | - this.run(message, true) | |
45 | + this.run(message, 'initialize') | |
46 | 46 | } |
47 | 47 | |
48 | 48 | // waits for the next message |
49 | 49 | async _runNextMessage () { |
@@ -72,18 +72,17 @@ | ||
72 | 72 | * @param {object} message - the message to run |
73 | 73 | * @param {boolean} init - whether or not to run the intialization routine |
74 | 74 | * @returns {Promise} |
75 | 75 | */ |
76 | - async run (message, init = false) { | |
76 | + async run (message, method = 'run') { | |
77 | 77 | let result |
78 | 78 | |
79 | 79 | message.ports.forEach(port => this.ports._unboundPorts.add(port)) |
80 | 80 | message._hops++ |
81 | 81 | |
82 | 82 | if (message.constructor === DeleteMessage) { |
83 | 83 | this.ports._delete(message.fromName) |
84 | 84 | } else { |
85 | - const method = init ? 'initialize' : 'run' | |
86 | 85 | try { |
87 | 86 | result = await this.container[method](message) || {} |
88 | 87 | } catch (e) { |
89 | 88 | result = { |
Built with git-ssb-web