Skip to content

Commit d155d69

Browse files
committedOct 25, 2024
fixup! module: trim off internal stack frames for require(esm) warnings
1 parent 789fd78 commit d155d69

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎lib/internal/util.js

+6
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ function slowCases(enc) {
266266
}
267267
}
268268

269+
/**
270+
* @param {string} feature Feature name used in the warning message
271+
* @param {string} messagePrefix Prefix of the warning message
272+
* @param {string} code See documentation of process.emitWarning
273+
* @param {string} ctor See documentation of process.emitWarning
274+
*/
269275
function emitExperimentalWarning(feature, messagePrefix, code, ctor) {
270276
if (experimentalWarnings.has(feature)) return;
271277
experimentalWarnings.add(feature);

‎test/es-module/test-require-module-warning.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spawnSyncAndAssert(process.execPath, [
2525
);
2626
assert.match(
2727
lines[2],
28-
/at require \(.*modules\/helpers\:\d+:\d+\)/
28+
/at require \(.*modules\/helpers:\d+:\d+\)/
2929
);
3030
assert.match(
3131
lines[3],

0 commit comments

Comments
 (0)
Please sign in to comment.