diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-08-02 00:17:06 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-08-03 15:41:14 +0200 |
commit | fb3d0e25cb38ec18f0318ccf1fcb97aa97baba61 (patch) | |
tree | bc827888d8e226a345a683d0b3d4a5354b03883c /lib/console.js | |
parent | 5a050550d377c53a9249f218888ea2e92a4d48dc (diff) | |
download | android-node-v8-fb3d0e25cb38ec18f0318ccf1fcb97aa97baba61.tar.gz android-node-v8-fb3d0e25cb38ec18f0318ccf1fcb97aa97baba61.tar.bz2 android-node-v8-fb3d0e25cb38ec18f0318ccf1fcb97aa97baba61.zip |
console,test: make message test more accurate
Make a message test more accurate in what it’s testing for.
This requires not swallowing stack overflow RangeErrors in
`console.log` and similar methods, which I would consider a
bugfix in itself.
PR-URL: https://github.com/nodejs/node/pull/14580
Fixes: https://github.com/nodejs/node-v8/issues/5
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/console.js')
-rw-r--r-- | lib/console.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/console.js b/lib/console.js index 08a6cf4fa7..48343bc3e8 100644 --- a/lib/console.js +++ b/lib/console.js @@ -94,6 +94,10 @@ function write(ignoreErrors, stream, string, errorhandler) { stream.write(string, errorhandler); } catch (e) { + // console is a debugging utility, so it swallowing errors is not desirable + // even in edge cases such as low stack space. + if (e.message === 'Maximum call stack size exceeded') + throw e; // Sorry, there’s no proper way to pass along the error here. } finally { stream.removeListener('error', noop); |