Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

bnoordhuis
Copy link
Member

@bnoordhuis bnoordhuis commented Aug 12, 2017

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/

global.console.log;
global.console.time;
global.console.timeEnd;
global.console.trace;
Copy link
Member

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.?

Copy link
Member Author

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.

Copy link
Member

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?

Copy link
Contributor

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?

Copy link
Member Author

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.

@refack
Copy link
Contributor

refack commented Aug 13, 2017

In that case do we still need 76d8746?
/cc @addaleax

Before this commit they were instantiated lazily but that fails when the
first call is under stack overflow conditions.

Fixes: nodejs/help#778
@bnoordhuis
Copy link
Member Author

jasnell pushed a commit that referenced this pull request Aug 23, 2017
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 <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>
@jasnell
Copy link
Member

jasnell commented Aug 23, 2017

Landed in da1af3d

@jasnell jasnell closed this Aug 23, 2017
@addaleax addaleax added the console Issues and PRs related to the console subsystem. label Aug 24, 2017
addaleax pushed a commit to addaleax/ayo that referenced this pull request Aug 25, 2017
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 <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>
addaleax pushed a commit to ayojs/ayo that referenced this pull request Aug 28, 2017
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 <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>
MylesBorins pushed a commit that referenced this pull request Sep 10, 2017
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 <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>
@MylesBorins MylesBorins mentioned this pull request Sep 10, 2017
MylesBorins pushed a commit that referenced this pull request Sep 12, 2017
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 <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>
@MylesBorins
Copy link
Contributor

Should this be backported to v6.x? If it is backported we will need to rewrite the test, as it relies on async / await

@BridgeAR
Copy link
Member

@MylesBorins the test was actually removed again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Issues and PRs related to the console subsystem. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.