@@ -50,29 +50,29 @@ describe('maybe top-level await syntax errors that are not recognized as top-lev
5050 } ) ;
5151
5252 it ( 'should throw the error for unrelated syntax errors' , async ( ) => {
53- const expression = " foo bar" ;
54- const wrapperExpressions = [
55- [ `function callSyntaxError() {}; callSyntaxError(${ expression } );` , / m i s s i n g \) a f t e r a r g u m e n t l i s t / ] ,
56- [ `if (${ expression } ) {}` , / U n e x p e c t e d i d e n t i f i e r / ] ,
57- [ `{ key: ${ expression } }` , / U n e x p e c t e d i d e n t i f i e r / ] ,
58- [ `[${ expression } ]` , / U n e x p e c t e d i d e n t i f i e r / ] ,
59- [ `(${ expression } )` , / U n e x p e c t e d i d e n t i f i e r / ] ,
60- [ `const ${ expression } = 1;` , / M i s s i n g i n i t i a l i z e r i n c o n s t d e c l a r a t i o n / ] ,
61- [ `console.log('PI: ' Math.PI);` , / m i s s i n g \) a f t e r a r g u m e n t l i s t / ] ,
62- [ `callAwait(await "" "");` , / m i s s i n g \) a f t e r a r g u m e n t l i s t / ]
63- ] ;
53+ const expression = ' foo bar' ;
54+ const wrapperExpressions = [
55+ [ `function callSyntaxError() {}; callSyntaxError(${ expression } );` , / m i s s i n g \) a f t e r a r g u m e n t l i s t / ] ,
56+ [ `if (${ expression } ) {}` , / U n e x p e c t e d i d e n t i f i e r / ] ,
57+ [ `{ key: ${ expression } }` , / U n e x p e c t e d i d e n t i f i e r / ] ,
58+ [ `[${ expression } ]` , / U n e x p e c t e d i d e n t i f i e r / ] ,
59+ [ `(${ expression } )` , / U n e x p e c t e d i d e n t i f i e r / ] ,
60+ [ `const ${ expression } = 1;` , / M i s s i n g i n i t i a l i z e r i n c o n s t d e c l a r a t i o n / ] ,
61+ [ `console.log('PI: ' Math.PI);` , / m i s s i n g \) a f t e r a r g u m e n t l i s t / ] ,
62+ [ `callAwait(await "" "");` , / m i s s i n g \) a f t e r a r g u m e n t l i s t / ] ,
63+ ] ;
6464
65- for ( const [ wrapperExpression , error ] of wrapperExpressions ) {
66- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
67- '--eval' ,
68- `
65+ for ( const [ wrapperExpression , error ] of wrapperExpressions ) {
66+ const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
67+ '--eval' ,
68+ `
6969 ${ wrapperExpression }
7070 ` ,
71- ] ) ;
72- match ( stderr , error ) ;
73- strictEqual ( stdout , '' ) ;
74- strictEqual ( code , 1 ) ;
75- strictEqual ( signal , null ) ;
76- }
71+ ] ) ;
72+ match ( stderr , error ) ;
73+ strictEqual ( stdout , '' ) ;
74+ strictEqual ( code , 1 ) ;
75+ strictEqual ( signal , null ) ;
76+ }
7777 } ) ;
7878} ) ;
0 commit comments