-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #53389 Fixes: #53385 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Kohei Ueno <[email protected]>
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hi!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'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/); | ||
} |