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

module: improve resolve paths validation #27613

Closed
wants to merge 1 commit into from

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented May 8, 2019

The first commit is just #27598, which I've included here just to avoid conflicts later.

This PR adds input validation to require.resolve()'s paths option. Prior to this change, passing in a non-array value lead to a misleading 'module not found' error.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 9, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/23016/

EDIT(cjihrig): CI was yellow.

@cjihrig
Copy link
Contributor Author

cjihrig commented May 10, 2019

Ping for reviews

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % comments.

lib/internal/modules/cjs/loader.js Show resolved Hide resolved
lib/internal/modules/cjs/loader.js Outdated Show resolved Hide resolved
This commit adds input validation to require.resolve()'s
paths option. Prior to this change, passing in a non-array
value lead to a misleading 'module not found' error.

Refs: nodejs#27583
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented May 10, 2019

CI: https://ci.nodejs.org/job/node-test-pull-request/23032/

EDIT(cjihrig): CI was yellow.

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 10, 2019
@Trott
Copy link
Member

Trott commented May 10, 2019

Landed in a608caa

@Trott Trott closed this May 10, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request May 10, 2019
This commit adds input validation to require.resolve()'s
paths option. Prior to this change, passing in a non-array
value lead to a misleading 'module not found' error.

Refs: nodejs#27583

PR-URL: nodejs#27613
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@cjihrig cjihrig deleted the paths-validate branch May 10, 2019 18:31
targos pushed a commit that referenced this pull request May 11, 2019
This commit adds input validation to require.resolve()'s
paths option. Prior to this change, passing in a non-array
value lead to a misleading 'module not found' error.

Refs: #27583

PR-URL: #27613
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@BridgeAR BridgeAR mentioned this pull request May 21, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants