@@ -409,91 +409,3 @@ describe('Wrapping a `require` of an ES module while using `--abort-on-uncaught-
409409 strictEqual ( signal , null ) ;
410410 } ) ;
411411} ) ;
412-
413- describe ( 'when working with Worker threads' , ( ) => {
414- it ( 'should support sloppy scripts that declare CJS "global-like" variables' , async ( ) => {
415- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
416- '--eval' ,
417- 'new worker_threads.Worker("let __filename,__dirname,require,module,exports;this.a",{eval:true})' ,
418- ] ) ;
419-
420- strictEqual ( stderr , '' ) ;
421- strictEqual ( stdout , '' ) ;
422- strictEqual ( code , 0 ) ;
423- strictEqual ( signal , null ) ;
424- } ) ;
425- } ) ;
426-
427- describe ( 'maybe top-level await syntax errors that are not recognized as top-level await errors' , ( ) => {
428- const expressions = [
429- // string
430- { expression : '""' } ,
431- // number
432- { expression : '0' } ,
433- // boolean
434- { expression : 'true' } ,
435- // null
436- { expression : 'null' } ,
437- // undefined
438- { expression : 'undefined' } ,
439- // object
440- { expression : '{}' } ,
441- // array
442- { expression : '[]' } ,
443- // new
444- { expression : 'new Date()' } ,
445- // identifier
446- { initialize : 'const a = 2;' , expression : 'a' } ,
447- ] ;
448- it ( 'should not crash the process' , async ( ) => {
449- for ( const { expression, initialize } of expressions ) {
450- const wrapperExpressions = [
451- `function callAwait() {}; callAwait(await ${ expression } );` ,
452- `if (await ${ expression } ) {}` ,
453- `{ key: await ${ expression } }` ,
454- `[await ${ expression } ]` ,
455- `(await ${ expression } )` ,
456- ] ;
457- for ( const wrapperExpression of wrapperExpressions ) {
458- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
459- '--eval' ,
460- `
461- ${ initialize || '' }
462- ${ wrapperExpression }
463- ` ,
464- ] ) ;
465-
466- strictEqual ( stderr , '' ) ;
467- strictEqual ( stdout , '' ) ;
468- strictEqual ( code , 0 ) ;
469- strictEqual ( signal , null ) ;
470- }
471- }
472- } ) ;
473-
474- it ( 'should crash when the expression is not valid' , async ( ) => {
475- let { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
476- '--eval' ,
477- `
478- function callAwait() {}
479- callAwait(await "" "");
480- ` ,
481- ] ) ;
482- match ( stderr , / S y n t a x E r r o r : m i s s i n g \) a f t e r a r g u m e n t l i s t / ) ;
483- strictEqual ( stdout , '' ) ;
484- strictEqual ( code , 1 ) ;
485- strictEqual ( signal , null ) ;
486-
487- ( { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
488- '--eval' ,
489- `
490- function callAwait() {}
491- if (a "") {}
492- ` ,
493- ] ) ) ;
494- match ( stderr , / S y n t a x E r r o r : U n e x p e c t e d s t r i n g / ) ;
495- strictEqual ( stdout , '' ) ;
496- strictEqual ( code , 1 ) ;
497- strictEqual ( signal , null ) ;
498- } ) ;
499- } ) ;
0 commit comments