From 94a78a86bc7848cce6e94b1431ed1901de8ab6f0 Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Tue, 23 Jul 2024 07:56:03 -0400 Subject: [PATCH] process: unify experimental warning messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/53704 Reviewed-By: Yagiz Nizipli Reviewed-By: Michaƫl Zasso Reviewed-By: Benjamin Gruenbaum Reviewed-By: Chemi Atlow Reviewed-By: James M Snell Reviewed-By: Marco Ippolito Reviewed-By: Filip Skokan Reviewed-By: Luigi Pinca --- lib/internal/process/pre_execution.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js index 8fad2fe617e4f8..59308ab817fb86 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js @@ -33,6 +33,7 @@ const { exposeLazyInterfaces, defineReplaceableLazyAttribute, setupCoverageHooks, + emitExperimentalWarning, } = require('internal/util'); const { @@ -569,8 +570,7 @@ function initializePermission() { }; // Guarantee path module isn't monkey-patched to bypass permission model ObjectFreeze(require('path')); - process.emitWarning('Permission is an experimental feature', - 'ExperimentalWarning'); + emitExperimentalWarning('Permission'); const { has } = require('internal/process/permission'); const warnFlags = [ '--allow-addons', @@ -709,8 +709,7 @@ function initializeSourceMapsHandlers() { function initializeFrozenIntrinsics() { if (getOptionValue('--frozen-intrinsics')) { - process.emitWarning('The --frozen-intrinsics flag is experimental', - 'ExperimentalWarning'); + emitExperimentalWarning('Frozen intristics'); require('internal/freeze_intrinsics')(); } }