bare-module 4.8.4 → 4.8.5
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 +12 -11
- package/lib/constants.d.ts +1 -0
- package/lib/constants.js +2 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -114,14 +114,9 @@ module.exports = exports = class Module {
|
|
|
114
114
|
Module._modules.delete(this)
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
_run() {
|
|
118
|
-
binding.runModule(this._handle, Module._handle, Module._onrun)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
117
|
_transform(isImport, isDynamicImport) {
|
|
122
118
|
if (isDynamicImport) {
|
|
123
|
-
this.
|
|
124
|
-
this._evaluate(true /* eagerRun */)
|
|
119
|
+
this._run()
|
|
125
120
|
} else if (isImport) {
|
|
126
121
|
this._synthesize()
|
|
127
122
|
} else {
|
|
@@ -205,7 +200,7 @@ module.exports = exports = class Module {
|
|
|
205
200
|
)
|
|
206
201
|
}
|
|
207
202
|
|
|
208
|
-
_evaluate(
|
|
203
|
+
_evaluate() {
|
|
209
204
|
if ((this._state & constants.states.EVALUATED) !== 0) return
|
|
210
205
|
|
|
211
206
|
this._state |= constants.states.EVALUATED
|
|
@@ -224,17 +219,23 @@ module.exports = exports = class Module {
|
|
|
224
219
|
urlToPath(this._url),
|
|
225
220
|
urlToDirname(this._url)
|
|
226
221
|
)
|
|
227
|
-
|
|
228
|
-
if (eagerRun) this._run()
|
|
229
222
|
} else if (this._type === constants.types.MODULE) {
|
|
230
223
|
this._run()
|
|
231
224
|
|
|
232
225
|
this._exports = binding.getNamespace(this._handle)
|
|
233
|
-
} else if (eagerRun) {
|
|
234
|
-
this._run()
|
|
235
226
|
}
|
|
236
227
|
}
|
|
237
228
|
|
|
229
|
+
_run() {
|
|
230
|
+
if ((this._state & constants.states.RUN) !== 0) return
|
|
231
|
+
|
|
232
|
+
this._state |= constants.states.RUN
|
|
233
|
+
|
|
234
|
+
this._synthesize()
|
|
235
|
+
|
|
236
|
+
binding.runModule(this._handle, Module._handle, Module._onrun)
|
|
237
|
+
}
|
|
238
|
+
|
|
238
239
|
[Symbol.for('bare.inspect')]() {
|
|
239
240
|
return {
|
|
240
241
|
__proto__: { constructor: Module },
|
package/lib/constants.d.ts
CHANGED
package/lib/constants.js
CHANGED