Commit 49cf67ef authored by Denis Zavershinskiy's avatar Denis Zavershinskiy Committed by Rich Trott
Browse files

doc: update experimental loader hooks example code

It fix 2 issues in provided Loader hooks examples:
1. Original ``new URL(`${process.cwd()}/`, 'file://');``
is not cross-platform, it gives wrong URL on windows
2. Based on `CHECK` in ModuleWrap::Resolve (node 12.9.1,
https://github.com/nodejs/node/blob/v12.9.1/src/module_wrap.cc#L1132)
the 2nd parameter should be a `string`, not an `URL` object

PR-URL: https://github.com/nodejs/node/pull/29373


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarDavid Carlier <devnexen@gmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
parent e2dcbf1c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment