Skip to content

Commit 4686931

Browse files
wip(core): rename import_
1 parent b033df3 commit 4686931

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/tools.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export function renameDynamicImport(fileAst : t.File) : void {
163163
CallExpression(path : NodePath<t.CallExpression>) {
164164

165165
if ( t.isImport(path.node.callee) )
166-
path.replaceWith(t.callExpression(t.identifier('import_'), path.node.arguments))
166+
path.replaceWith(t.callExpression(t.identifier('import__'), path.node.arguments))
167167
}
168168
});
169169
}
@@ -310,7 +310,7 @@ export function createModule(refPath : string, source : string, options : Option
310310
throw new Error(`${ id } not found in moduleCache`);
311311
}
312312

313-
const import_ = async function(relPath : string) {
313+
const importFunction = async function(relPath : string) {
314314

315315
return await loadModuleInternal({ refPath, relPath }, options);
316316
}
@@ -321,7 +321,7 @@ export function createModule(refPath : string, source : string, options : Option
321321

322322
// see https://github.com/nodejs/node/blob/a46b21f556a83e43965897088778ddc7d46019ae/lib/internal/modules/cjs/loader.js#L195-L198
323323
// see https://github.com/nodejs/node/blob/a46b21f556a83e43965897088778ddc7d46019ae/lib/internal/modules/cjs/loader.js#L1102
324-
Function('exports', 'require', 'module', '__filename', '__dirname', 'import_', source).call(module.exports, module.exports, require, module, refPath, resolve({ refPath, relPath: '.' }), import_);
324+
Function('exports', 'require', 'module', '__filename', '__dirname', 'import__', source).call(module.exports, module.exports, require, module, refPath, resolve({ refPath, relPath: '.' }), importFunction);
325325

326326
return module;
327327
}

0 commit comments

Comments
 (0)