Skip to content

Commit dfb4a24

Browse files
Alex Zherdevtargos
Alex Zherdev
authored andcommitted
doc: fix an error in resolution algorithm steps
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>
1 parent 2505f67 commit dfb4a24

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

doc/api/modules.md

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ require(X) from module at path Y
159159
3. If X begins with './' or '/' or '../'
160160
a. LOAD_AS_FILE(Y + X)
161161
b. LOAD_AS_DIRECTORY(Y + X)
162+
c. THROW "not found"
162163
4. LOAD_NODE_MODULES(X, dirname(Y))
163164
5. LOAD_SELF_REFERENCE(X, dirname(Y))
164165
6. THROW "not found"

0 commit comments

Comments
 (0)