-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib: instantiate console methods eagerly #14791
Conversation
lib/internal/bootstrap_node.js
Outdated
global.console.log; | ||
global.console.time; | ||
global.console.timeEnd; | ||
global.console.trace; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other console methods though, like console.warn
etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're aliases for (e.g.) console.error
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about the new ones like console.count()
, console.countReset()
and console.clear()
? Are those needed here also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like console.dir()
should be included here as well as it's not an alias?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about console.dir(). The others seem less important but I've added them too.
Before this commit they were instantiated lazily but that fails when the first call is under stack overflow conditions. Fixes: nodejs/help#778
a87cf22
to
70bbb10
Compare
Rebased + new CI: https://ci.nodejs.org/job/node-test-pull-request/9705/ |
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]>
Landed in da1af3d |
Before this commit they were instantiated lazily but that fails when the first call is under stack overflow conditions. PR-URL: nodejs/node#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]>
Before this commit they were instantiated lazily but that fails when the first call is under stack overflow conditions. PR-URL: nodejs/node#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]>
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]>
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]>
Should this be backported to v6.x? If it is backported we will need to rewrite the test, as it relies on async / await |
@MylesBorins the test was actually removed again. |
Before this commit they were instantiated lazily but that fails when the
first call is under stack overflow conditions.
Fixes: nodejs/help#778
CI: https://ci.nodejs.org/job/node-test-pull-request/9629/