File tree Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Expand file tree Collapse file tree 2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 8282 delete process . env . NODE_UNIQUE_ID ;
8383 }
8484
85- // Load any preload modules
86- if ( process . _preload_modules ) {
87- var Module = NativeModule . require ( 'module' ) ;
88- process . _preload_modules . forEach ( function ( module ) {
89- Module . _load ( module ) ;
90- } ) ;
91- }
92-
9385 if ( process . _eval != null ) {
9486 // User passed '-e' or '--eval' arguments to Node.
87+ startup . preloadModules ( ) ;
9588 evalScript ( '[eval]' ) ;
9689 } else if ( process . argv [ 1 ] ) {
9790 // make process.argv[1] into a full path
9891 var path = NativeModule . require ( 'path' ) ;
9992 process . argv [ 1 ] = path . resolve ( process . argv [ 1 ] ) ;
10093
10194 var Module = NativeModule . require ( 'module' ) ;
102-
95+ startup . preloadModules ( ) ;
10396 if ( global . v8debug &&
10497 process . execArgv . some ( function ( arg ) {
10598 return arg . match ( / ^ - - d e b u g - b r k ( = [ 0 - 9 ] * ) ? $ / ) ;
857850 } ;
858851 } ;
859852
853+ // Load preload modules
854+ startup . preloadModules = function ( ) {
855+ if ( process . _preload_modules ) {
856+ var Module = NativeModule . require ( 'module' ) ;
857+ process . _preload_modules . forEach ( function ( module ) {
858+ Module . _load ( module ) ;
859+ } ) ;
860+ }
861+ } ;
862+
860863 // Below you find a minimal module system, which is used to load the node
861864 // core modules found in lib/*.js. All core modules are compiled into the
862865 // node binary, so they can be loaded faster.
Original file line number Diff line number Diff line change @@ -80,3 +80,15 @@ child_process.exec(nodeBinary + ' '
8080 if ( err ) throw err ;
8181 assert . ok ( / w o r k e r t e r m i n a t e d w i t h c o d e 4 3 / . test ( stdout ) ) ;
8282 } ) ;
83+
84+ // https://github.com/iojs/io.js/issues/1691
85+ var originalCwd = process . cwd ( ) ;
86+ process . chdir ( path . join ( __dirname , '../fixtures/' ) ) ;
87+ child_process . exec ( nodeBinary + ' '
88+ + '--expose_debug_as=v8debug '
89+ + '--require ' + fixture ( 'cluster-preload.js' ) + ' '
90+ + 'cluster-preload-test.js' ,
91+ function ( err , stdout , stderr ) {
92+ if ( err ) throw err ;
93+ assert . ok ( / w o r k e r t e r m i n a t e d w i t h c o d e 4 3 / . test ( stdout ) ) ;
94+ } ) ;
You can’t perform that action at this time.
0 commit comments