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

doc: fix an error in resolution algorithm steps #29940

Closed
wants to merge 1 commit into from

Conversation

@alexzherdev
Copy link
Contributor

alexzherdev commented Oct 11, 2019

As it is, if X begins with './' or '/' or '../' (step 3), it reads as if it were possible for the algorithm to do a node_modules lookup (step 4) when 3.a or 3.b couldn't find the module. But that doesn't seem to reflect the actual logic.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
@@ -159,6 +159,7 @@ require(X) from module at path Y
3. If X begins with './' or '/' or '../'
a. LOAD_AS_FILE(Y + X)
b. LOAD_AS_DIRECTORY(Y + X)
c. THROW "not found"
4. LOAD_NODE_MODULES(X, dirname(Y))

This comment has been minimized.

Copy link
@ljharb

ljharb Oct 12, 2019

Member

alternatively, could this be prefixed with “else”?

This comment has been minimized.

Copy link
@alexzherdev

alexzherdev Oct 12, 2019

Author Contributor

I thought of that but noticed that other steps here prefer throwing in the if instead.

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Oct 14, 2019

Member

I agree it's consistent with the other blocks.

@ljharb

This comment has been minimized.

Copy link
Member

ljharb commented Oct 12, 2019

@@ -159,6 +159,7 @@ require(X) from module at path Y
3. If X begins with './' or '/' or '../'
a. LOAD_AS_FILE(Y + X)
b. LOAD_AS_DIRECTORY(Y + X)
c. THROW "not found"
4. LOAD_NODE_MODULES(X, dirname(Y))

This comment has been minimized.

Copy link
@bnoordhuis

bnoordhuis Oct 14, 2019

Member

I agree it's consistent with the other blocks.

@jkrems
jkrems approved these changes Oct 14, 2019
Copy link
Contributor

jkrems left a comment

I think this is correct.

As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.
@alexzherdev alexzherdev force-pushed the alexzherdev:patch-1 branch from a1d85ca to 1a141ba Oct 14, 2019
@alexzherdev

This comment has been minimized.

Copy link
Contributor Author

alexzherdev commented Oct 14, 2019

Fixed the commit message to wrap at 72 characters.

@danbev

This comment has been minimized.

@alexzherdev

This comment has been minimized.

Copy link
Contributor Author

alexzherdev commented Oct 29, 2019

Waiting for #30117 to land before resolving the conflicts.

@jkrems

This comment has been minimized.

Copy link
Contributor

jkrems commented Oct 29, 2019

Landed that PR, should be safe to rebase now!

@alexzherdev

This comment has been minimized.

Copy link
Contributor Author

alexzherdev commented Oct 29, 2019

Huh, looks like there's no conflicts here anymore 😄

@jkrems
jkrems approved these changes Oct 30, 2019
@jkrems jkrems self-assigned this Oct 30, 2019
jkrems added a commit that referenced this pull request Oct 30, 2019
As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.

PR-URL: #29940
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jkrems

This comment has been minimized.

Copy link
Contributor

jkrems commented Oct 30, 2019

Landed in 6f39f10

@jkrems jkrems closed this Oct 30, 2019
@jkrems jkrems removed their assignment Oct 30, 2019
@alexzherdev alexzherdev deleted the alexzherdev:patch-1 branch Oct 30, 2019
targos added a commit that referenced this pull request Nov 5, 2019
As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.

PR-URL: #29940
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request Nov 5, 2019
targos added a commit that referenced this pull request Nov 8, 2019
As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.

PR-URL: #29940
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Nov 10, 2019
As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.

PR-URL: #29940
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Nov 10, 2019
As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.

PR-URL: #29940
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos added a commit that referenced this pull request Nov 11, 2019
As it is, if `X begins with './' or '/' or '../'` (step 3), it reads
as if it were possible for the algorithm to do a node_modules lookup
(step 4). But that doesn't seem to reflect the actual logic.

PR-URL: #29940
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.