File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,10 @@ void SetConsoleExtensionInstaller(const FunctionCallbackInfo<Value>& info) {
181181
182182void CallAndPauseOnStart (const FunctionCallbackInfo<v8::Value>& args) {
183183 Environment* env = Environment::GetCurrent (args);
184+ THROW_IF_INSUFFICIENT_PERMISSIONS (env,
185+ permission::PermissionScope::kInspector ,
186+ " PauseOnNextJavascriptStatement"
187+ );
184188 CHECK_GT (args.Length (), 1 );
185189 CHECK (args[0 ]->IsFunction ());
186190 SlicedArguments call_args (args, /* start */ 2 );
Original file line number Diff line number Diff line change 1+ console . log ( 'done' ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ const common = require ( '../common' ) ;
4+ const assert = require ( 'assert' ) ;
5+ const { spawnSync } = require ( 'child_process' ) ;
6+ const fixtures = require ( '../common/fixtures' ) ;
7+ const file = fixtures . path ( 'permission' , 'inspector-brk.js' ) ;
8+
9+ common . skipIfWorker ( ) ;
10+ common . skipIfInspectorDisabled ( ) ;
11+
12+ const { status, stderr } = spawnSync (
13+ process . execPath ,
14+ [
15+ '--experimental-permission' ,
16+ '--allow-fs-read=*' ,
17+ '--inspect-brk' ,
18+ file ,
19+ ] ,
20+ ) ;
21+
22+ assert . strictEqual ( status , 1 ) ;
23+ assert . match ( stderr . toString ( ) , / E r r o r : A c c e s s t o t h i s A P I h a s b e e n r e s t r i c t e d / ) ;
You can’t perform that action at this time.
0 commit comments