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

Module resolution description does not reflect the implementation #7151

Closed
tai2 opened this issue Jun 4, 2016 · 2 comments
Closed

Module resolution description does not reflect the implementation #7151

tai2 opened this issue Jun 4, 2016 · 2 comments
Labels
doc Issues and PRs related to the documentations. module Issues and PRs related to the module subsystem.

Comments

@tai2
Copy link

tai2 commented Jun 4, 2016

  • Version: v4.4.3
  • Platform: Darwin James.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64
  • Subsystem: Modules

I've just read this:

All Together...
https://nodejs.org/docs/latest/api/modules.html#modules_all_together

From this document, if a script in /Uesrs/foo (Y) does require('/b.js'); (X), it should be resolved to /Users/foo/b.js (Y + X). But as long as I tested, it's resolved to an absolute path (/b.js).

I guess either the document or implementation is wrong.

Here is the code.
https://gist.github.com/tai2/b2121a67cfab8b1945cc4b292fc737dd

@tai2 tai2 changed the title Module resolution description does not reflect to the implementation Module resolution description does not reflect the implementation Jun 4, 2016
@Fishrock123 Fishrock123 added the module Issues and PRs related to the module subsystem. label Jun 4, 2016
@ChALkeR ChALkeR added the doc Issues and PRs related to the documentations. label Jun 4, 2016
@bnoordhuis
Copy link
Member

Apparently it's been wrongly documented ever since it was first added, more than five years ago in commit ff39d41.

bmeck added a commit to bmeck/node that referenced this issue Mar 17, 2017
@bmeck
Copy link
Member

bmeck commented Mar 17, 2017

PR #11897

MylesBorins pushed a commit that referenced this issue Mar 28, 2017
PR-URL: #11897
Fixes: #7151
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this issue Apr 18, 2017
PR-URL: #11897
Fixes: #7151
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
MylesBorins pushed a commit that referenced this issue Apr 19, 2017
PR-URL: #11897
Fixes: #7151
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
andrew749 pushed a commit to michielbaird/node that referenced this issue Jul 19, 2017
PR-URL: nodejs/node#11897
Fixes: nodejs/node#7151
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. module Issues and PRs related to the module subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants