◐ Shell
clean mode source ↗

module: trim off internal stack frames for require(esm) warnings · nodejs/node@fdf5028

@@ -255,14 +255,20 @@ function slowCases(enc) {

255255

}

256256

}

257257258-

function emitExperimentalWarning(feature, messagePrefix) {

258+

/**

259+

* @param {string} feature Feature name used in the warning message

260+

* @param {string} messagePrefix Prefix of the warning message

261+

* @param {string} code See documentation of process.emitWarning

262+

* @param {string} ctor See documentation of process.emitWarning

263+

*/

264+

function emitExperimentalWarning(feature, messagePrefix, code, ctor) {

259265

if (experimentalWarnings.has(feature)) return;

260266

experimentalWarnings.add(feature);

261267

let msg = `${feature} is an experimental feature and might change at any time`;

262268

if (messagePrefix) {

263269

msg = messagePrefix + msg;

264270

}

265-

process.emitWarning(msg, 'ExperimentalWarning');

271+

process.emitWarning(msg, 'ExperimentalWarning', code, ctor);

266272

}

267273268274

function filterDuplicateStrings(items, low) {