|
122 | 122 |
|
123 | 123 | const internalModule = NativeModule.require('internal/module');
|
124 | 124 | internalModule.addBuiltinLibsToObject(global);
|
125 |
| - run(() => { |
126 |
| - evalScript('[eval]'); |
127 |
| - }); |
| 125 | + evalScript('[eval]'); |
128 | 126 | } else if (process.argv[1]) {
|
129 | 127 | // make process.argv[1] into a full path
|
130 | 128 | const path = NativeModule.require('path');
|
|
143 | 141 | }
|
144 | 142 |
|
145 | 143 | preloadModules();
|
146 |
| - run(Module.runMain); |
| 144 | + Module.runMain(); |
147 | 145 | } else {
|
148 | 146 | preloadModules();
|
149 | 147 | // If -i or --interactive were passed, or stdin is a TTY.
|
|
417 | 415 | }
|
418 | 416 | }
|
419 | 417 |
|
420 |
| - function isDebugBreak() { |
421 |
| - return process.execArgv.some((arg) => /^--debug-brk(=[0-9]+)?$/.test(arg)); |
422 |
| - } |
423 |
| - |
424 |
| - function run(entryFunction) { |
425 |
| - if (process._debugWaitConnect && isDebugBreak()) { |
426 |
| - |
427 |
| - // XXX Fix this terrible hack! |
428 |
| - // |
429 |
| - // Give the client program a few ticks to connect. |
430 |
| - // Otherwise, there's a race condition where `node debug foo.js` |
431 |
| - // will not be able to connect in time to catch the first |
432 |
| - // breakpoint message on line 1. |
433 |
| - // |
434 |
| - // A better fix would be to somehow get a message from the |
435 |
| - // V8 debug object about a connection, and runMain when |
436 |
| - // that occurs. --isaacs |
437 |
| - |
438 |
| - const debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50; |
439 |
| - setTimeout(entryFunction, debugTimeout); |
440 |
| - |
441 |
| - } else { |
442 |
| - // Main entry point into most programs: |
443 |
| - entryFunction(); |
444 |
| - } |
445 |
| - } |
446 |
| - |
447 | 418 | function checkScriptSyntax(source, filename) {
|
448 | 419 | const Module = NativeModule.require('module');
|
449 | 420 | const vm = NativeModule.require('vm');
|
|
0 commit comments