diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2017-08-12 15:49:41 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-08-23 11:41:15 -0700 |
commit | da1af3d3fc1b6c780070167527ef1964fcfc81f6 (patch) | |
tree | b4dfbd8b748faad33a78abce900dd9aa42cb14bb /test/message | |
parent | 779a480bf171148a47fab6822076837825726746 (diff) | |
download | android-node-v8-da1af3d3fc1b6c780070167527ef1964fcfc81f6.tar.gz android-node-v8-da1af3d3fc1b6c780070167527ef1964fcfc81f6.tar.bz2 android-node-v8-da1af3d3fc1b6c780070167527ef1964fcfc81f6.zip |
lib: instantiate console methods eagerly
Before this commit they were instantiated lazily but that fails when the
first call is under stack overflow conditions.
PR-URL: https://github.com/nodejs/node/pull/14791
Fixes: https://github.com/nodejs/help#778
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/message')
-rw-r--r-- | test/message/stack_overflow_async.js | 18 | ||||
-rw-r--r-- | test/message/stack_overflow_async.out | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/message/stack_overflow_async.js b/test/message/stack_overflow_async.js new file mode 100644 index 0000000000..9aefbf9557 --- /dev/null +++ b/test/message/stack_overflow_async.js @@ -0,0 +1,18 @@ +// Flags: --stack_trace_limit=3 + +'use strict'; +require('../common'); + +async function f() { + await f(); +} + +async function g() { + try { + await f(); + } catch (e) { + console.log(e); + } +} + +g(); diff --git a/test/message/stack_overflow_async.out b/test/message/stack_overflow_async.out new file mode 100644 index 0000000000..4028c7642a --- /dev/null +++ b/test/message/stack_overflow_async.out @@ -0,0 +1,4 @@ +RangeError: Maximum call stack size exceeded + at f (*test*message*stack_overflow_async.js:*) + at f (*test*message*stack_overflow_async.js:7:*) + at f (*test*message*stack_overflow_async.js:7:*) |