Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"node:" prefix #45001

Closed
meku opened this issue Oct 14, 2022 · 1 comment · Fixed by #45147
Closed

"node:" prefix #45001

meku opened this issue Oct 14, 2022 · 1 comment · Fixed by #45147

Comments

@meku
Copy link

meku commented Oct 14, 2022

Module._resolveLookupPaths = function(request, parent) {

Since the function does not check the built-in module "node:" prefix, unnecessary operations occur. It will directly return "null" if changed as follows;
( StringPrototypeStartsWith(request, 'node:') && BuiltinModule.canBeRequiredByUsers(StringPrototypeSlice(request, 5)) ) || ( BuiltinModule.canBeRequiredByUsers(request) && BuiltinModule.canBeRequiredWithoutScheme(request) )

@meku meku closed this as completed Oct 14, 2022
@meku meku reopened this Oct 14, 2022
@meku
Copy link
Author

meku commented Oct 15, 2022

This confirms an incorrect result as follows:
console.log(require.resolve.paths("node:url"));
result:
[ 'G:\\www\\nodejs\\node_modules', 'G:\\www\\node_modules', 'G:\\node_modules']

fossamagna added a commit to fossamagna/node that referenced this issue Oct 24, 2022
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: nodejs#45001
nodejs-github-bot pushed a commit that referenced this issue Nov 20, 2022
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
ruyadorno pushed a commit that referenced this issue Nov 21, 2022
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
marco-ippolito pushed a commit to marco-ippolito/node that referenced this issue Nov 23, 2022
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: nodejs#45001
PR-URL: nodejs#45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
danielleadams pushed a commit that referenced this issue Dec 30, 2022
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
danielleadams pushed a commit that referenced this issue Dec 30, 2022
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
danielleadams pushed a commit that referenced this issue Jan 3, 2023
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
danielleadams pushed a commit that referenced this issue Jan 4, 2023
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
danielleadams pushed a commit that referenced this issue Jan 5, 2023
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
BethGriggs pushed a commit that referenced this issue Mar 27, 2023
require.resolve.paths should returns null with builtin module.
when builtin module without `node:` schema, `paths` returns null.
But, it don't return null when builtin module with `node:` schema.

Fixes: #45001
PR-URL: #45147
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant