mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
430c026911
PR-URL: https://github.com/nodejs/node/pull/53389 Fixes: https://github.com/nodejs/node/issues/53385 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
42 lines
958 B
JavaScript
42 lines
958 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
const fixtures = require('../common/fixtures');
|
|
const file = fixtures.path('permission', 'inspector-brk.js');
|
|
|
|
common.skipIfWorker();
|
|
common.skipIfInspectorDisabled();
|
|
|
|
// See https://github.com/nodejs/node/issues/53385
|
|
{
|
|
const { status, stderr } = spawnSync(
|
|
process.execPath,
|
|
[
|
|
'--experimental-permission',
|
|
'--allow-fs-read=*',
|
|
'--inspect-brk',
|
|
file,
|
|
],
|
|
);
|
|
|
|
assert.strictEqual(status, 1);
|
|
assert.match(stderr.toString(), /Error: Access to this API has been restricted/);
|
|
}
|
|
|
|
{
|
|
const { status, stderr } = spawnSync(
|
|
process.execPath,
|
|
[
|
|
'--experimental-permission',
|
|
'--inspect-brk',
|
|
'--eval',
|
|
'console.log("Hi!")',
|
|
],
|
|
);
|
|
|
|
assert.strictEqual(status, 1);
|
|
assert.match(stderr.toString(), /Error: Access to this API has been restricted/);
|
|
}
|