Skip to content

Commit

Permalink
src: condense experimental warning message
Browse files Browse the repository at this point in the history
PR-URL: #45424
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
  • Loading branch information
Trott authored Nov 13, 2022
1 parent 6a22b77 commit 1255db7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
3 changes: 1 addition & 2 deletions lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,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');
}
Expand Down
3 changes: 1 addition & 2 deletions src/node_process_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ Maybe<bool> 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");
}

Expand Down
7 changes: 4 additions & 3 deletions test/common/measure-memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-vfs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
3 changes: 1 addition & 2 deletions test/wasi/test-wasi-symlinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 1 addition & 2 deletions test/wasi/test-wasi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1255db7

Please sign in to comment.