Skip to content

Commit c3a6af2

Browse files
committed
lib: add hot path for noDeprecation for esm
1 parent 85ac915 commit c3a6af2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

benchmark/esm/esm-loader-defaultResolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const configs = {
2626
};
2727

2828
const options = {
29-
flags: ['--expose-internals'],
29+
flags: ['--expose-internals', '--no-deprecation'],
3030
};
3131

3232
const bench = common.createBenchmark(main, configs, options);

lib/internal/modules/esm/resolve.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ function emitInvalidSegmentDeprecation(target, request, match, pjsonUrl, interna
103103
* @returns {void}
104104
*/
105105
function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) {
106+
if (process.noDeprecation) {
107+
return;
108+
}
109+
106110
const format = defaultGetFormatWithoutErrors(url);
107111
if (format !== 'module')
108112
return;

0 commit comments

Comments
 (0)