summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorYakov Litvin <yakov.litvin.publicly@gmail.com>2020-01-21 01:35:35 +0300
committerShelley Vohr <shelley.vohr@gmail.com>2020-02-17 10:56:23 -0800
commit67d8967f98961e3367df1ae52e8ffcdc7a3e3399 (patch)
treee71c267e7b942a213477b3a75c6d756b93c1e92b /doc/api
parent049a1727d494503dbcdeb6ad021557812e9159ed (diff)
downloadnode-new-67d8967f98961e3367df1ae52e8ffcdc7a3e3399.tar.gz
doc: add explanatory to path.resolve description
Fixes: https://github.com/nodejs/node/issues/25542 PR-URL: https://github.com/nodejs/node/pull/31430 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/path.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/api/path.md b/doc/api/path.md
index e4b4160540..477ef2cab0 100644
--- a/doc/api/path.md
+++ b/doc/api/path.md
@@ -477,7 +477,8 @@ an absolute path.
The given sequence of paths is processed from right to left, with each
subsequent `path` prepended until an absolute path is constructed.
For instance, given the sequence of path segments: `/foo`, `/bar`, `baz`,
-calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz`.
+calling `path.resolve('/foo', '/bar', 'baz')` would return `/bar/baz`
+because `'baz'` is not an absolute path but `'/bar' + '/' + 'baz'` is.
If after processing all given `path` segments an absolute path has not yet
been generated, the current working directory is used.