bare-module 3.1.7 → 3.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -29,6 +29,7 @@ const Module = module.exports = exports = class Module {
|
|
|
29
29
|
this._protocol = null
|
|
30
30
|
this._bundle = null
|
|
31
31
|
this._function = null
|
|
32
|
+
this._names = null
|
|
32
33
|
this._handle = null
|
|
33
34
|
|
|
34
35
|
Module._modules.add(this)
|
|
@@ -179,7 +180,9 @@ const Module = module.exports = exports = class Module {
|
|
|
179
180
|
}
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
this.
|
|
183
|
+
this._names = names
|
|
184
|
+
|
|
185
|
+
this._handle = binding.createSyntheticModule(this._url.href, this._names, Module._handle)
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
_evaluate (eagerRun = false) {
|
|
@@ -280,10 +283,8 @@ const Module = module.exports = exports = class Module {
|
|
|
280
283
|
|
|
281
284
|
module._evaluate()
|
|
282
285
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
for (const [key, value] of Object.entries(module._exports)) {
|
|
286
|
-
binding.setExport(module._handle, key, value)
|
|
286
|
+
for (const name of module._names) {
|
|
287
|
+
binding.setExport(module._handle, name, name === 'default' ? module._exports : module._exports[name])
|
|
287
288
|
}
|
|
288
289
|
}
|
|
289
290
|
|