From 8ad0dfff1017b6db129a72150e9cc37fe6fa8b2d Mon Sep 17 00:00:00 2001 From: chirsz Date: Fri, 27 Sep 2024 23:34:38 +0800 Subject: [PATCH] doc: fix the require resolve algorithm in `modules.md` Before the fix, the pseudocode was describing an infinite loop. PR-URL: https://github.com/nodejs/node/pull/55117 Reviewed-By: Antoine du Hamel Reviewed-By: Chemi Atlow --- doc/api/modules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/modules.md b/doc/api/modules.md index c60a334a52143d..c63d3cf4d4e3bc 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -325,7 +325,7 @@ NODE_MODULES_PATHS(START) 2. let I = count of PARTS - 1 3. let DIRS = [] 4. while I >= 0, - a. if PARTS[I] = "node_modules" CONTINUE + a. if PARTS[I] = "node_modules", GOTO d. b. DIR = path join(PARTS[0 .. I] + "node_modules") c. DIRS = DIR + DIRS d. let I = I - 1