@@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
88of this.
99
1010diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
11- index 84fea979d482d3d5cacfad4b09237e6345675cad..678ed0a7b43c30c5dd6102d83f490e23c95090ce 100644
11+ index ea3b411a78..ad4946a6d1 100644
1212--- a/lib/internal/modules/cjs/loader.js
1313+++ b/lib/internal/modules/cjs/loader.js
14- @@ -1215 ,6 +1215 ,13 @@ Module.prototype._compile = function(content, filename) {
14+ @@ -1351 ,6 +1351 ,13 @@ Module.prototype._compile = function(content, filename) {
1515 if (getOptionValue('--inspect-brk') && process._eval == null) {
1616 if (!resolvedArgv) {
1717 // We enter the repl if we're not given a filename argument.
@@ -26,22 +26,24 @@ index 84fea979d482d3d5cacfad4b09237e6345675cad..678ed0a7b43c30c5dd6102d83f490e23
2626 try {
2727 resolvedArgv = Module._resolveFilename(process.argv[1], null, false);
2828diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js
29- index 0dc769846b4e6fe84438cd6d8024c4a89eb90a9b..bff9bdc7ad58183e9eb04ee45b76592b4240952a 100644
29+ index 66dfd7c1e5..5db54daaa9 100644
3030--- a/lib/internal/process/pre_execution.js
3131+++ b/lib/internal/process/pre_execution.js
32- @@ -204,11 +204,13 @@ function patchProcessObject(expandArgv1) {
32+ @@ -218,12 +218,14 @@ function patchProcessObject(expandArgv1) {
3333 if (expandArgv1 && process.argv[1] &&
3434 !StringPrototypeStartsWith(process.argv[1], '-')) {
3535 // Expand process.argv[1] into a full path.
3636- const path = require('path');
3737- try {
38- - process.argv[1] = path.resolve(process.argv[1]);
38+ - mainEntry = path.resolve(process.argv[1]);
39+ - process.argv[1] = mainEntry;
3940- } catch {
4041- // Continue regardless of error.
4142+ if (!process.argv[1] || !process.argv[1].startsWith('electron/js2c')) {
4243+ const path = require('path');
4344+ try {
44- + process.argv[1] = path.resolve(process.argv[1]);
45+ + mainEntry = path.resolve(process.argv[1]);
46+ + process.argv[1] = mainEntry;
4547+ } catch {
4648+ // Continue regardless of error.
4749+ }
0 commit comments