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) {
259265if (experimentalWarnings.has(feature)) return;
260266experimentalWarnings.add(feature);
261267let msg = `${feature} is an experimental feature and might change at any time`;
262268if (messagePrefix) {
263269msg = messagePrefix + msg;
264270}
265-process.emitWarning(msg, 'ExperimentalWarning');
271+process.emitWarning(msg, 'ExperimentalWarning', code, ctor);
266272}
267273268274function filterDuplicateStrings(items, low) {