@@ -144,7 +144,7 @@ const schemelessBlockList = new SafeSet([
144144'DEP0111' ) ;
145145}
146146if ( legacyWrapperList . has ( module ) ) {
147- return nativeModuleRequire ( 'internal/legacy/processbinding' ) [ module ] ( ) ;
147+ return requireBuiltin ( 'internal/legacy/processbinding' ) [ module ] ( ) ;
148148}
149149return internalBinding ( module ) ;
150150}
@@ -285,14 +285,14 @@ class BuiltinModule {
285285// TODO(aduh95): move this to C++, alongside the initialization of the class.
286286ObjectSetPrototypeOf ( ModuleWrap . prototype , null ) ;
287287const url = `node:${ this . id } ` ;
288- const nativeModule = this ;
288+ const builtin = this ;
289289const exportsKeys = ArrayPrototypeSlice ( this . exportKeys ) ;
290290ArrayPrototypePush ( exportsKeys , 'default' ) ;
291291this . module = new ModuleWrap (
292292url , undefined , exportsKeys ,
293293function ( ) {
294- nativeModule . syncExports ( ) ;
295- this . setExport ( 'default' , nativeModule . exports ) ;
294+ builtin . syncExports ( ) ;
295+ this . setExport ( 'default' , builtin . exports ) ;
296296} ) ;
297297// Ensure immediate sync execution to capture exports now
298298this . module . instantiate ( ) ;
@@ -326,7 +326,7 @@ class BuiltinModule {
326326
327327try {
328328const requireFn = StringPrototypeStartsWith ( this . id , 'internal/deps/' ) ?
329- requireWithFallbackInDeps : nativeModuleRequire ;
329+ requireWithFallbackInDeps : requireBuiltin ;
330330
331331const fn = compileFunction ( id ) ;
332332// Arguments must match the parameters specified in
@@ -350,10 +350,10 @@ class BuiltinModule {
350350const loaderExports = {
351351 internalBinding,
352352 BuiltinModule,
353- require : nativeModuleRequire
353+ require : requireBuiltin
354354} ;
355355
356- function nativeModuleRequire ( id ) {
356+ function requireBuiltin ( id ) {
357357if ( id === loaderId ) {
358358return loaderExports ;
359359}
@@ -371,7 +371,7 @@ function requireWithFallbackInDeps(request) {
371371if ( ! BuiltinModule . map . has ( request ) ) {
372372request = `internal/deps/${ request } ` ;
373373}
374- return nativeModuleRequire ( request ) ;
374+ return requireBuiltin ( request ) ;
375375}
376376
377377// Pass the exports back to C++ land for C++ internals to use.
0 commit comments