-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
node: do not override
message
/stack
of error
Put the `...^` arrow string to the hidden property of the object, and use it only when printing error to the stderr. Fix: #2104 PR-URL: #2108 Reviewed-By: Trevor Norris <[email protected]>
- Loading branch information
Showing
4 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
var common = require('../common'); | ||
var assert = require('assert'); | ||
var child_process = require('child_process'); | ||
|
||
var p = child_process.spawn(process.execPath, [ | ||
'-e', | ||
'vm = require("vm");' + | ||
'context = vm.createContext({});' + | ||
'try { vm.runInContext("throw new Error(\'boo\')", context); } ' + | ||
'catch (e) { console.log(e.message); }' | ||
]); | ||
|
||
p.stderr.on('data', function(data) { | ||
assert(false, 'Unexpected stderr data: ' + data); | ||
}); | ||
|
||
var output = ''; | ||
|
||
p.stdout.on('data', function(data) { | ||
output += data; | ||
}); | ||
|
||
process.on('exit', function() { | ||
assert.equal(output.replace(/[\r\n]+/g, ''), 'boo'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters