GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: fix regression that a source marker is lost · nodejs/node@2c47e58

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_errors.cc
  • test/parallel
    • test-error-reporting.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_errors.cc‎

Copy file name to clipboardExpand all lines: src/node_errors.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ static std::string GetErrorSource(Isolate* isolate,
6262
// added in the JavaScript context:
6363
Environment* env = Environment::GetCurrent(isolate);
6464
const bool has_source_map_url =
65-
!message->GetScriptOrigin().SourceMapUrl().IsEmpty();
65+
!message->GetScriptOrigin().SourceMapUrl().IsEmpty() &&
66+
!message->GetScriptOrigin().SourceMapUrl()->IsUndefined();
6667
if (has_source_map_url && env != nullptr && env->source_maps_enabled()) {
6768
return sourceline;
6869
}
Collapse file

‎test/parallel/test-error-reporting.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-error-reporting.js
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ const assert = require('assert');
2525
const exec = require('child_process').exec;
2626
const fixtures = require('../common/fixtures');
2727

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)}"`;
3032
return exec(cmd, (err, stdout, stderr) => {
3133
// There was some error
3234
assert.ok(err);
@@ -79,3 +81,8 @@ errExec('throws_error6.js', common.mustCall((err, stdout, stderr) => {
7981
errExec('throws_error7.js', common.mustCall((err, stdout, stderr) => {
8082
assert.match(stderr, /throw {\r?\n\^\r?\n{ toString: \[Function: toString] }\r?\n\r?\nNode\.js \S+\r?\n$/);
8183
}));
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+
}));

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.