File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ function enrichCJSError(err) {
9797 usage. However, some cases are not matching, cases like import statement
9898 after a comment block and/or after a variable definition.
9999 */
100- if ( err . message . startsWith ( 'Unexpected token export' ) ||
100+ if ( err . message . startsWith ( 'Unexpected token \' export\' ' ) ||
101101 ( / ^ \s * i m p o r t (? = [ { ' " * ] ) \s * (? ! [ ( ] ) / ) . test ( lineWithErr ) ) {
102102 process . emitWarning (
103103 '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)'));
1313
1414v8 . setFlagsFromString ( '--noallow_natives_syntax' ) ;
1515assert . 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 ' % ' $ / ) ;
1717assert . 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');
152152 ) ;
153153 } , {
154154 type : SyntaxError ,
155- message : ' Unexpected token }'
155+ message : " Unexpected token '}'"
156156 } ) ;
157157
158158 // Tests for failed argument validation
You can’t perform that action at this time.
0 commit comments