modules: move modules/cjs/helpers.js to modules/helpers.js · nodejs/node@c6ab449 · GitHub
Skip to content

Commit c6ab449

Browse files
joyeecheungtargos
authored andcommitted
modules: move modules/cjs/helpers.js to modules/helpers.js
The helpers are actually shared by the two loaders, so move them under modules/ directly. PR-URL: #45849 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 508e830 commit c6ab449

9 files changed

Lines changed: 8 additions & 8 deletions

File tree

lib/internal/main/eval_string.js

Lines changed: 1 addition & 1 deletion

lib/internal/modules/cjs/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const {
103103
makeRequireFunction,
104104
normalizeReferrerURL,
105105
stripBOM,
106-
} = require('internal/modules/cjs/helpers');
106+
} = require('internal/modules/helpers');
107107
const { getOptionValue } = require('internal/options');
108108
const preserveSymlinks = getOptionValue('--preserve-symlinks');
109109
const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');

lib/internal/modules/esm/translators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const {
3030
hasEsmSyntax,
3131
loadBuiltinModule,
3232
stripBOM,
33-
} = require('internal/modules/cjs/helpers');
33+
} = require('internal/modules/helpers');
3434
const {
3535
Module: CJSModule,
3636
cjsParseCache

lib/internal/source_map/source_map_cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const { getOptionValue } = require('internal/options');
2727
const { IterableWeakMap } = require('internal/util/iterable_weak_map');
2828
const {
2929
normalizeReferrerURL,
30-
} = require('internal/modules/cjs/helpers');
30+
} = require('internal/modules/helpers');
3131
const { validateBoolean } = require('internal/validators');
3232
const { setMaybeCacheGeneratedSourceMap } = internalBinding('errors');
3333

lib/internal/util/inspector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function installConsoleExtensions(commandLineApi) {
6666
if (commandLineApi.require) { return; }
6767
const { tryGetCwd } = require('internal/process/execution');
6868
const CJSModule = require('internal/modules/cjs/loader').Module;
69-
const { makeRequireFunction } = require('internal/modules/cjs/helpers');
69+
const { makeRequireFunction } = require('internal/modules/helpers');
7070
const consoleAPIModule = new CJSModule('<inspector console>');
7171
const cwd = tryGetCwd();
7272
consoleAPIModule.paths = ArrayPrototypeConcat(

lib/repl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const { BuiltinModule } = require('internal/bootstrap/loaders');
101101
const {
102102
makeRequireFunction,
103103
addBuiltinLibsToObject
104-
} = require('internal/modules/cjs/helpers');
104+
} = require('internal/modules/helpers');
105105
const {
106106
isIdentifierStart,
107107
isIdentifierChar

test/parallel/test-bootstrap-modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const expectedModules = new Set([
5353
'NativeModule internal/fs/utils',
5454
'NativeModule internal/idna',
5555
'NativeModule internal/linkedlist',
56-
'NativeModule internal/modules/cjs/helpers',
56+
'NativeModule internal/modules/helpers',
5757
'NativeModule internal/modules/cjs/loader',
5858
'NativeModule internal/modules/esm/assert',
5959
'NativeModule internal/modules/esm/formats',

test/parallel/test-util-inspect.js

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)