File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ function enrichCJSError(err) {
97
97
usage. However, some cases are not matching, cases like import statement
98
98
after a comment block and/or after a variable definition.
99
99
*/
100
- if ( err . message . startsWith ( 'Unexpected token export' ) ||
100
+ if ( err . message . startsWith ( 'Unexpected token \' export\' ' ) ||
101
101
( / ^ \s * i m p o r t (? = [ { ' " * ] ) \s * (? ! [ ( ] ) / ) . test ( lineWithErr ) ) {
102
102
process . emitWarning (
103
103
'To load an ES module, set "type": "module" in the package.json or use ' +
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ assert(vm.runInThisContext('%_IsSmi(43)'));
13
13
14
14
v8 . setFlagsFromString ( '--noallow_natives_syntax' ) ;
15
15
assert . throws ( function ( ) { eval ( '%_IsSmi(44)' ) ; } ,
16
- / ^ S y n t a x E r r o r : U n e x p e c t e d t o k e n % $ / ) ;
16
+ / ^ S y n t a x E r r o r : U n e x p e c t e d t o k e n ' % ' $ / ) ;
17
17
assert . throws ( function ( ) { vm . runInThisContext ( '%_IsSmi(45)' ) ; } ,
18
- / ^ S y n t a x E r r o r : U n e x p e c t e d t o k e n % $ / ) ;
18
+ / ^ S y n t a x E r r o r : U n e x p e c t e d t o k e n ' % ' $ / ) ;
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ const vm = require('vm');
152
152
) ;
153
153
} , {
154
154
type : SyntaxError ,
155
- message : ' Unexpected token }'
155
+ message : " Unexpected token '}'"
156
156
} ) ;
157
157
158
158
// Tests for failed argument validation
You can’t perform that action at this time.
0 commit comments