@@ -24,6 +24,7 @@ const fixtureB = fixtures.path('printB.js');
2424const fixtureC = fixtures . path ( 'printC.js' ) ;
2525const fixtureD = fixtures . path ( 'define-global.js' ) ;
2626const fixtureE = fixtures . path ( 'intrinsic-mutation.js' ) ;
27+ const fixtureF = fixtures . path ( 'print-intrinsic-mutation-name.js' ) ;
2728const fixtureThrows = fixtures . path ( 'throws_error4.js' ) ;
2829
2930// Test preloading a single module works
@@ -65,18 +66,28 @@ childProcess.exec(
6566
6667// Test that preload can be used with --frozen-intrinsics
6768childProcess . exec (
68- `"${ nodeBinary } " --frozen-intrinsics ${ preloadOption ( [ fixtureE ] ) } -e "console.log('hello');"` ,
69+ `"${ nodeBinary } " --frozen-intrinsics ${
70+ preloadOption ( [ fixtureE ] )
71+ } ${
72+ fixtureF
73+ } `,
6974 function ( err , stdout ) {
7075 assert . ifError ( err ) ;
71- assert . strictEqual ( stdout , 'hello \n' ) ;
76+ assert . strictEqual ( stdout , 'smoosh \n' ) ;
7277 }
7378) ;
74- const workerSrc = `const {Worker} = require('worker_threads');new Worker(${ JSON . stringify ( fixtureA ) } );` ;
79+ const workerSrc = `new ( require('worker_threads'). Worker) (${ fixtureF } );` ;
7580childProcess . exec (
76- `"${ nodeBinary } " --frozen-intrinsics ${ preloadOption ( [ fixtureE ] ) } -e ${ JSON . stringify ( workerSrc ) } ` ,
81+ `"${
82+ nodeBinary
83+ } " --frozen-intrinsics ${
84+ preloadOption ( [ fixtureE ] )
85+ } -e ${
86+ workerSrc
87+ } `,
7788 function ( err , stdout ) {
7889 assert . ifError ( err ) ;
79- assert . strictEqual ( stdout , 'A \n' ) ;
90+ assert . strictEqual ( stdout , 'smoosh \n' ) ;
8091 }
8192) ;
8293
0 commit comments