File tree 2 files changed +24
-9
lines changed
2 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 82
82
delete process . env . NODE_UNIQUE_ID ;
83
83
}
84
84
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
-
93
85
if ( process . _eval != null ) {
94
86
// User passed '-e' or '--eval' arguments to Node.
87
+ startup . preloadModules ( ) ;
95
88
evalScript ( '[eval]' ) ;
96
89
} else if ( process . argv [ 1 ] ) {
97
90
// make process.argv[1] into a full path
98
91
var path = NativeModule . require ( 'path' ) ;
99
92
process . argv [ 1 ] = path . resolve ( process . argv [ 1 ] ) ;
100
93
101
94
var Module = NativeModule . require ( 'module' ) ;
102
-
95
+ startup . preloadModules ( ) ;
103
96
if ( global . v8debug &&
104
97
process . execArgv . some ( function ( arg ) {
105
98
return arg . match ( / ^ - - d e b u g - b r k ( = [ 0 - 9 ] * ) ? $ / ) ;
857
850
} ;
858
851
} ;
859
852
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
+
860
863
// Below you find a minimal module system, which is used to load the node
861
864
// core modules found in lib/*.js. All core modules are compiled into the
862
865
// 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 + ' '
80
80
if ( err ) throw err ;
81
81
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 ) ) ;
82
82
} ) ;
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