mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
3ab0499d43
PR-URL: https://github.com/nodejs/node/pull/53124 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
26 lines
574 B
JavaScript
26 lines
574 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const { spawnSync } = require('child_process');
|
|
const assert = require('assert');
|
|
|
|
const warnFlags = [
|
|
'--allow-addons',
|
|
'--allow-child-process',
|
|
'--allow-wasi',
|
|
'--allow-worker',
|
|
];
|
|
|
|
for (const flag of warnFlags) {
|
|
const { status, stderr } = spawnSync(
|
|
process.execPath,
|
|
[
|
|
'--experimental-permission', flag, '-e',
|
|
'setTimeout(() => {}, 1)',
|
|
]
|
|
);
|
|
|
|
assert.match(stderr.toString(), new RegExp(`SecurityWarning: The flag ${flag} must be used with extreme caution`));
|
|
assert.strictEqual(status, 0);
|
|
}
|