@@ -144,7 +144,7 @@ const schemelessBlockList = new SafeSet([ |
144 | 144 | 'DEP0111'); |
145 | 145 | } |
146 | 146 | if (legacyWrapperList.has(module)) { |
147 | | - return nativeModuleRequire('internal/legacy/processbinding')[module](); |
| 147 | + return requireBuiltin('internal/legacy/processbinding')[module](); |
148 | 148 | } |
149 | 149 | return internalBinding(module); |
150 | 150 | } |
@@ -285,14 +285,14 @@ class BuiltinModule { |
285 | 285 | // TODO(aduh95): move this to C++, alongside the initialization of the class. |
286 | 286 | ObjectSetPrototypeOf(ModuleWrap.prototype, null); |
287 | 287 | const url = `node:${this.id}`; |
288 | | - const nativeModule = this; |
| 288 | + const builtin = this; |
289 | 289 | const exportsKeys = ArrayPrototypeSlice(this.exportKeys); |
290 | 290 | ArrayPrototypePush(exportsKeys, 'default'); |
291 | 291 | this.module = new ModuleWrap( |
292 | 292 | url, undefined, exportsKeys, |
293 | 293 | function() { |
294 | | - nativeModule.syncExports(); |
295 | | - this.setExport('default', nativeModule.exports); |
| 294 | + builtin.syncExports(); |
| 295 | + this.setExport('default', builtin.exports); |
296 | 296 | }); |
297 | 297 | // Ensure immediate sync execution to capture exports now |
298 | 298 | this.module.instantiate(); |
@@ -326,7 +326,7 @@ class BuiltinModule { |
326 | 326 |
|
327 | 327 | try { |
328 | 328 | const requireFn = StringPrototypeStartsWith(this.id, 'internal/deps/') ? |
329 | | - requireWithFallbackInDeps : nativeModuleRequire; |
| 329 | + requireWithFallbackInDeps : requireBuiltin; |
330 | 330 |
|
331 | 331 | const fn = compileFunction(id); |
332 | 332 | // Arguments must match the parameters specified in |
@@ -350,10 +350,10 @@ class BuiltinModule { |
350 | 350 | const loaderExports = { |
351 | 351 | internalBinding, |
352 | 352 | BuiltinModule, |
353 | | - require: nativeModuleRequire |
| 353 | + require: requireBuiltin |
354 | 354 | }; |
355 | 355 |
|
356 | | -function nativeModuleRequire(id) { |
| 356 | +function requireBuiltin(id) { |
357 | 357 | if (id === loaderId) { |
358 | 358 | return loaderExports; |
359 | 359 | } |
@@ -371,7 +371,7 @@ function requireWithFallbackInDeps(request) { |
371 | 371 | if (!BuiltinModule.map.has(request)) { |
372 | 372 | request = `internal/deps/${request}`; |
373 | 373 | } |
374 | | - return nativeModuleRequire(request); |
| 374 | + return requireBuiltin(request); |
375 | 375 | } |
376 | 376 |
|
377 | 377 | // Pass the exports back to C++ land for C++ internals to use. |
|