summaryrefslogtreecommitdiff
path: root/doc/api/modules.md
diff options
context:
space:
mode:
authorBradley Farias <bradley.meck@gmail.com>2017-03-17 08:16:44 -0500
committerJames M Snell <jasnell@gmail.com>2017-03-21 23:06:52 -0700
commit757ff8071e212703e3e8f2849751e7745479ac87 (patch)
tree3bdeaf6dae76e77e150058313cfd9ae2e58c1c02 /doc/api/modules.md
parent757c90e53c64ec8605f8471ae1b7672de23da61e (diff)
downloadandroid-node-v8-757ff8071e212703e3e8f2849751e7745479ac87.tar.gz
android-node-v8-757ff8071e212703e3e8f2849751e7745479ac87.tar.bz2
android-node-v8-757ff8071e212703e3e8f2849751e7745479ac87.zip
doc: require uses fs root for '/' prefix
PR-URL: https://github.com/nodejs/node/pull/11897 Fixes: https://github.com/nodejs/node/issues/7151 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/modules.md')
-rw-r--r--doc/api/modules.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/api/modules.md b/doc/api/modules.md
index a0c669f209..397964c251 100644
--- a/doc/api/modules.md
+++ b/doc/api/modules.md
@@ -149,11 +149,13 @@ require(X) from module at path Y
1. If X is a core module,
a. return the core module
b. STOP
-2. If X begins with './' or '/' or '../'
+2. If X begins with '/'
+ a. set Y to be the filesystem root
+3. If X begins with './' or '/' or '../'
a. LOAD_AS_FILE(Y + X)
b. LOAD_AS_DIRECTORY(Y + X)
-3. LOAD_NODE_MODULES(X, dirname(Y))
-4. THROW "not found"
+4. LOAD_NODE_MODULES(X, dirname(Y))
+5. THROW "not found"
LOAD_AS_FILE(X)
1. If X is a file, load X as JavaScript text. STOP