git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit d4ba20b58c01dea031c4dbd86e4a99d066ca1c28

move buildImports to be internal

wanderer committed on 11/22/2016, 2:35:31 AM
Parent: 51739ba9fc171bb7d0f5e1bfee7b9021587cdede

Files changed

index.jschanged
index.jsView
@@ -12,20 +12,20 @@
1212 // if code is bound to this kernel then create the interfaceAPI and the
1313 // imports
1414 if (opts.code) {
1515 this.interfaceAPI = new InterfaceAPI(opts.code)
16- this.imports = this.buildImports(opts.interfaces)
16+ this.imports = buildImports(this.interfaceAPI, opts.interfaces)
1717 }
18- }
1918
20- /**
21- * Builds a import map with an array of given interfaces
22- */
23- buildImports (interfaces = [Interface]) {
24- return interfaces.reduce((obj, Interface) => {
25- obj[Interface.name] = new Interface(this.interfaceAPI).exports
26- return obj
27- }, {})
19+ /**
20+ * Builds a import map with an array of given interfaces
21+ */
22+ function buildImports (api, interfaces = [Interface]) {
23+ return interfaces.reduce((obj, Interface) => {
24+ obj[Interface.name] = new Interface(api).exports
25+ return obj
26+ }, {})
27+ }
2828 }
2929
3030 /**
3131 * run the kernels code with a given enviroment

Built with git-ssb-web