git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 7ac6686f9ca7efa10273c565fc2e749c25a4604e

remove kenerl vertex

wanderer committed on 11/22/2016, 5:45:37 PM
Parent: 366cf8208f4cd25c7c689fd76120241482ec7989

Files changed

deps/kernelVertex.jsdeleted
index.jschanged
deps/kernelVertex.jsView
@@ -1,12 +1,0 @@
1-const Vertex = require('merkle-trie')
2-
3-module.exports = class KernelVertex extends Vertex {
4- get kernel () {
5- return this._cache.kernel
6- }
7-
8- set kernel (instance) {
9- this._cache.kernel = instance
10- }
11-}
12-
index.jsView
@@ -1,14 +1,14 @@
1-const Vertex = require('./deps/kernelVertex')
1+const Vertex = require('merkle-trie')
22 // The Kernel Exposes this Interface to VM instances it makes
33 const Imports = require('./EVMimports.js')
44 const VM = require('./vm.js')
55 const Environment = require('./environment.js')
66
7-module.exports = class Kernel {
7+module.exports = class Kernel extends Vertex {
88 constructor (opts = {}) {
9- this.state = opts.state || new Vertex()
10- this.parent = opts.parent
9+ opts.code = opts.value || opts.code
10+ super(opts)
1111
1212 // if code is bound to this kernel then create the interfaceAPI and the imports
1313 if (opts.code) {
1414 this._vm = new VM(opts.code)
@@ -30,9 +30,9 @@
3030 * run the kernels code with a given enviroment
3131 * The Kernel Stores all of its state in the Environment. The Interface is used
3232 * to by the VM to retrive infromation from the Environment.
3333 */
34- async run (environment = new Environment({state: this.state}), imports = this.imports) {
34+ async run (environment = new Environment({state: this}), imports = this.imports) {
3535 await this._vm.run(environment, imports)
3636 }
3737
3838 async messageReceiver (message) {

Built with git-ssb-web