Commit f2217cd
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: #29373
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent bf08c08 commit f2217cd
1 file changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | | - | |
577 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
578 | 584 | | |
579 | 585 | | |
580 | 586 | | |
| |||
612 | 618 | | |
613 | 619 | | |
614 | 620 | | |
| 621 | + | |
615 | 622 | | |
616 | 623 | | |
617 | 624 | | |
618 | 625 | | |
619 | | - | |
| 626 | + | |
620 | 627 | | |
621 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
622 | 636 | | |
623 | 637 | | |
624 | 638 | | |
| |||
627 | 641 | | |
628 | 642 | | |
629 | 643 | | |
630 | | - | |
| 644 | + | |
631 | 645 | | |
632 | 646 | | |
633 | 647 | | |
| |||
0 commit comments