GeezerVison is showing github.com — esm: remove support for deprecated hooks · nodejs/node@ca20f59
File tree
Expand file treeCollapse file tree
Open diff view settings
fixtures/es-module-loaders
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/hooks.js -37Lines changed: 0 additions & 37 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | 'use strict'; |
2 | 2 |
|
3 | 3 | const { |
4 | | - ArrayPrototypeJoin, |
5 | 4 | ArrayPrototypePush, |
6 | 5 | FunctionPrototypeCall, |
7 | 6 | Int32Array, |
@@ -658,45 +657,9 @@ function pluckHooks({ |
658 | 657 | globalPreload, |
659 | 658 | resolve, |
660 | 659 | load, |
661 | | - // obsolete hooks: |
662 | | - dynamicInstantiate, |
663 | | - getFormat, |
664 | | - getGlobalPreloadCode, |
665 | | - getSource, |
666 | | - transformSource, |
667 | 660 | }) { |
668 | | - const obsoleteHooks = []; |
669 | 661 | const acceptedHooks = { __proto__: null }; |
670 | 662 |
|
671 | | - if (getGlobalPreloadCode) { |
672 | | - globalPreload ??= getGlobalPreloadCode; |
673 | | - |
674 | | - process.emitWarning( |
675 | | - 'Loader hook "getGlobalPreloadCode" has been renamed to "globalPreload"', |
676 | | - ); |
677 | | - } |
678 | | - if (dynamicInstantiate) { |
679 | | - ArrayPrototypePush(obsoleteHooks, 'dynamicInstantiate'); |
680 | | - } |
681 | | - if (getFormat) { |
682 | | - ArrayPrototypePush(obsoleteHooks, 'getFormat'); |
683 | | - } |
684 | | - if (getSource) { |
685 | | - ArrayPrototypePush(obsoleteHooks, 'getSource'); |
686 | | - } |
687 | | - if (transformSource) { |
688 | | - ArrayPrototypePush(obsoleteHooks, 'transformSource'); |
689 | | - } |
690 | | - |
691 | | - if (obsoleteHooks.length) { |
692 | | - process.emitWarning( |
693 | | - `Obsolete loader hook(s) supplied and will be ignored: ${ |
694 | | - ArrayPrototypeJoin(obsoleteHooks, ', ') |
695 | | - }`, |
696 | | - 'DeprecationWarning', |
697 | | - ); |
698 | | - } |
699 | | - |
700 | 663 | if (globalPreload) { |
701 | 664 | acceptedHooks.globalPreload = globalPreload; |
702 | 665 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: test/es-module/test-esm-loader-obsolete-hooks.mjs -28Lines changed: 0 additions & 28 deletions Collapse file
Copy file name to clipboardExpand all lines: test/fixtures/es-module-loaders/hooks-obsolete.mjs -22Lines changed: 0 additions & 22 deletions