-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: #14791 Fixes: https://github.com/nodejs/help#778 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Timothy Gu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
- Loading branch information
1 parent
ae27cb8
commit f34e0f9
Showing
3 changed files
with
40 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
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,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:*) |