File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,17 @@ const stackRe = /^([\s\S]*?)\r?\nStack:\r?\n([\s\S]*)$/;
11
11
const stackFrameRe = / ^ ( .* ?) ? @ ( .* ?) : ( \d + ) : ( \d + ) ? $ / ;
12
12
13
13
class JSShell extends ConsoleAgent {
14
- async evalScript ( code , options = { } ) {
15
- if ( options . module && this . args [ 0 ] !== '--module' ) {
16
- this . args . unshift ( '--module' ) ;
14
+ constructor ( options ) {
15
+ super ( options ) ;
16
+ if ( this . args . indexOf ( '--module' ) !== - 1 ) {
17
+ throw new Error ( "Passing --module as a SpiderMonkey host argument is not supported." )
17
18
}
19
+ }
18
20
19
- if ( ! options . module && this . args [ 0 ] === '--module' ) {
20
- this . args . shift ( ) ;
21
+ async evalScript ( code , options = { } ) {
22
+ if ( options . module ) {
23
+ // The file name must come immediataly after the `--module` flag.
24
+ this . args . push ( '--module' ) ;
21
25
}
22
26
23
27
return super . evalScript ( code , options ) ;
You can’t perform that action at this time.
0 commit comments