From 3dc6be637a71c97c7f61b6b3d19a7723438fc18e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 12 Nov 2022 20:11:13 -0800 Subject: [PATCH] src: condense experimental warning message PR-URL: https://github.com/nodejs/node/pull/45424 Reviewed-By: Yagiz Nizipli Reviewed-By: Moshe Atlow --- lib/internal/util.js | 3 +-- src/node_process_events.cc | 3 +-- test/common/measure-memory.js | 7 ++++--- test/parallel/test-vfs.js | 3 ++- test/wasi/test-wasi-symlinks.js | 3 +-- test/wasi/test-wasi.js | 3 +-- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/internal/util.js b/lib/internal/util.js index e284a1c37a5487..615d4c36c19b0e 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -221,8 +221,7 @@ function slowCases(enc) { function emitExperimentalWarning(feature) { if (experimentalWarnings.has(feature)) return; - const msg = `${feature} is an experimental feature. This feature could ` + - 'change at any time'; + const msg = `${feature} is an experimental feature and might change at any time`; experimentalWarnings.add(feature); process.emitWarning(msg, 'ExperimentalWarning'); } diff --git a/src/node_process_events.cc b/src/node_process_events.cc index 944b0605b148b7..f4c39d7dd9eb68 100644 --- a/src/node_process_events.cc +++ b/src/node_process_events.cc @@ -92,8 +92,7 @@ Maybe ProcessEmitExperimentalWarning(Environment* env, experimental_warnings.insert(warning); std::string message(warning); - message.append( - " is an experimental feature. This feature could change at any time"); + message.append(" is an experimental feature and might change at any time"); return ProcessEmitWarningGeneric(env, message.c_str(), "ExperimentalWarning"); } diff --git a/test/common/measure-memory.js b/test/common/measure-memory.js index a42f6344268d12..82b3ca61d14f05 100644 --- a/test/common/measure-memory.js +++ b/test/common/measure-memory.js @@ -43,9 +43,10 @@ function assertSingleDetailedShape(result) { } function expectExperimentalWarning() { - common.expectWarning('ExperimentalWarning', - 'vm.measureMemory is an experimental feature. ' + - 'This feature could change at any time'); + common.expectWarning( + 'ExperimentalWarning', + 'vm.measureMemory is an experimental feature and might change at any time' + ); } module.exports = { diff --git a/test/parallel/test-vfs.js b/test/parallel/test-vfs.js index c4842be3a839d0..84e77f4bd58cd8 100644 --- a/test/parallel/test-vfs.js +++ b/test/parallel/test-vfs.js @@ -34,7 +34,8 @@ throws(() => require(vfsFile), { code: 'MODULE_NOT_FOUND' }); common.expectWarning( 'ExperimentalWarning', - 'Module._stat is an experimental feature. This feature could change at any time'); + 'Module._stat is an experimental feature and might change at any time' +); process.on('warning', common.mustCall()); diff --git a/test/wasi/test-wasi-symlinks.js b/test/wasi/test-wasi-symlinks.js index 1389707671adcb..c2f29e539a5ed8 100644 --- a/test/wasi/test-wasi-symlinks.js +++ b/test/wasi/test-wasi-symlinks.js @@ -5,8 +5,7 @@ const path = require('path'); if (process.argv[2] === 'wasi-child') { common.expectWarning('ExperimentalWarning', - 'WASI is an experimental feature. This feature could ' + - 'change at any time'); + 'WASI is an experimental feature and might change at any time'); const { WASI } = require('wasi'); const wasmDir = path.join(__dirname, 'wasm'); diff --git a/test/wasi/test-wasi.js b/test/wasi/test-wasi.js index 6c00b5a7b72503..b514de731adf85 100644 --- a/test/wasi/test-wasi.js +++ b/test/wasi/test-wasi.js @@ -8,8 +8,7 @@ if (process.argv[2] === 'wasi-child') { const path = require('path'); common.expectWarning('ExperimentalWarning', - 'WASI is an experimental feature. This feature could ' + - 'change at any time'); + 'WASI is an experimental feature and might change at any time'); const { WASI } = require('wasi'); tmpdir.refresh();