From fb3d0e25cb38ec18f0318ccf1fcb97aa97baba61 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 2 Aug 2017 00:17:06 +0200 Subject: console,test: make message test more accurate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Ben Noordhuis --- lib/console.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/console.js') 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); -- cgit v1.2.3