@@ -161,11 +161,12 @@ const schemelessBlockList = new SafeSet([
161
161
}
162
162
163
163
// Set up internalBinding() in the closure.
164
- let internalBinding ;
164
+ // Do not use `internalBinding` variable name due to the breakage of TypeScript autocompletion.
165
+ let _internalBinding ;
165
166
{
166
167
const bindingObj = { __proto__ : null } ;
167
168
// eslint-disable-next-line no-global-assign
168
- internalBinding = function internalBinding ( module ) {
169
+ _internalBinding = function internalBinding ( module ) {
169
170
let mod = bindingObj [ module ] ;
170
171
if ( typeof mod !== 'object' ) {
171
172
mod = bindingObj [ module ] = getInternalBinding ( module ) ;
@@ -180,7 +181,7 @@ const {
180
181
builtinIds,
181
182
compileFunction,
182
183
setInternalLoaders,
183
- } = internalBinding ( 'builtins' ) ;
184
+ } = _internalBinding ( 'builtins' ) ;
184
185
185
186
const getOwn = ( target , property , receiver ) => {
186
187
return ObjectPrototypeHasOwnProperty ( target , property ) ?
@@ -278,7 +279,7 @@ class BuiltinModule {
278
279
279
280
getESMFacade ( ) {
280
281
if ( this . module ) return this . module ;
281
- const { ModuleWrap } = internalBinding ( 'module_wrap' ) ;
282
+ const { ModuleWrap } = _internalBinding ( 'module_wrap' ) ;
282
283
// TODO(aduh95): move this to C++, alongside the initialization of the class.
283
284
ObjectSetPrototypeOf ( ModuleWrap . prototype , null ) ;
284
285
const url = `node:${ this . id } ` ;
@@ -328,7 +329,7 @@ class BuiltinModule {
328
329
const fn = compileFunction ( id ) ;
329
330
// Arguments must match the parameters specified in
330
331
// BuiltinLoader::LookupAndCompile().
331
- fn ( this . exports , requireFn , this , process , internalBinding , primordials ) ;
332
+ fn ( this . exports , requireFn , this , process , _internalBinding , primordials ) ;
332
333
333
334
this . loaded = true ;
334
335
} finally {
@@ -345,7 +346,7 @@ class BuiltinModule {
345
346
// Think of this as module.exports in this file even though it is not
346
347
// written in CommonJS style.
347
348
const loaderExports = {
348
- internalBinding,
349
+ internalBinding : _internalBinding ,
349
350
BuiltinModule,
350
351
require : requireBuiltin ,
351
352
} ;
@@ -372,4 +373,4 @@ function requireWithFallbackInDeps(request) {
372
373
}
373
374
374
375
// Store the internal loaders in C++.
375
- setInternalLoaders ( internalBinding , requireBuiltin ) ;
376
+ setInternalLoaders ( _internalBinding , requireBuiltin ) ;
0 commit comments