| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5aa3b21 commit 2c47e58
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,7 +62,8 @@ static std::string GetErrorSource(Isolate* isolate, | |||
| 62 | 62 | // added in the JavaScript context: | |
| 63 | 63 | Environment* env = Environment::GetCurrent(isolate); | |
| 64 | 64 | const bool has_source_map_url = | |
| 65 | - !message->GetScriptOrigin().SourceMapUrl().IsEmpty(); | ||
| 65 | + !message->GetScriptOrigin().SourceMapUrl().IsEmpty() && | ||
| 66 | + !message->GetScriptOrigin().SourceMapUrl()->IsUndefined(); | ||
| 66 | 67 | if (has_source_map_url && env != nullptr && env->source_maps_enabled()) { | |
| 67 | 68 | return sourceline; | |
| 68 | 69 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,8 +25,10 @@ const assert = require('assert'); | |||
| 25 | 25 | const exec = require('child_process').exec; | |
| 26 | 26 | const fixtures = require('../common/fixtures'); | |
| 27 | 27 | ||
| 28 | - function errExec(script, callback) { | ||
| 29 | - const cmd = `"${process.argv[0]}" "${fixtures.path(script)}"`; | ||
| 28 | + function errExec(script, option, callback) { | ||
| 29 | + callback = typeof option === 'function' ? option : callback; | ||
| 30 | + option = typeof option === 'string' ? option : ''; | ||
| 31 | + const cmd = `"${process.argv[0]}" ${option} "${fixtures.path(script)}"`; | ||
| 30 | 32 | return exec(cmd, (err, stdout, stderr) => { | |
| 31 | 33 | // There was some error | |
| 32 | 34 | assert.ok(err); | |
@@ -79,3 +81,8 @@ errExec('throws_error6.js', common.mustCall((err, stdout, stderr) => { | |||
| 79 | 81 | errExec('throws_error7.js', common.mustCall((err, stdout, stderr) => { | |
| 80 | 82 | assert.match(stderr, /throw {\r?\n\^\r?\n{ toString: \[Function: toString] }\r?\n\r?\nNode\.js \S+\r?\n$/); | |
| 81 | 83 | })); | |
| 84 | + | ||
| 85 | + // Regression tests for https://github.com/nodejs/node/issues/39149 | ||
| 86 | + errExec('throws_error7.js', '--enable-source-maps', common.mustCall((err, stdout, stderr) => { | ||
| 87 | + assert.match(stderr, /throw {\r?\n\^\r?\n{ toString: \[Function: toString] }\r?\n\r?\nNode\.js \S+\r?\n$/); | ||
| 88 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments