@@ -12,15 +12,15 @@ const resolvedPromise = SafePromise.resolve();
|
12 | 12 | class ModuleJob { |
13 | 13 | // `loader` is the Loader instance used for loading dependencies. |
14 | 14 | // `moduleProvider` is a function |
15 | | -constructor(loader, url, moduleProvider, inspectBrk) { |
| 15 | +constructor(loader, url, moduleProvider, isMain) { |
16 | 16 | this.loader = loader; |
17 | 17 | this.error = null; |
18 | 18 | this.hadError = false; |
19 | | -this.inspectBrk = inspectBrk; |
| 19 | +this.isMain = isMain; |
20 | 20 | |
21 | 21 | // This is a Promise<{ module, reflect }>, whose fields will be copied |
22 | 22 | // onto `this` by `link()` below once it has been resolved. |
23 | | -this.modulePromise = moduleProvider(url); |
| 23 | +this.modulePromise = moduleProvider(url, isMain); |
24 | 24 | this.module = undefined; |
25 | 25 | this.reflect = undefined; |
26 | 26 | |
@@ -82,7 +82,8 @@ class ModuleJob {
|
82 | 82 | throw e; |
83 | 83 | } |
84 | 84 | try { |
85 | | -if (this.inspectBrk) { |
| 85 | +if (this.isMain && process._breakFirstLine) { |
| 86 | +delete process._breakFirstLine; |
86 | 87 | const initWrapper = process.binding('inspector').callAndPauseOnStart; |
87 | 88 | initWrapper(this.module.instantiate, this.module); |
88 | 89 | } else { |
|