console,test: make message test more accurate#14580
Closed
addaleax wants to merge 1 commit intonodejs:masterfrom
Closed
console,test: make message test more accurate#14580addaleax wants to merge 1 commit intonodejs:masterfrom
addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
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. Fixes: nodejs/node-v8#5
lpinca
reviewed
Aug 2, 2017
| if (compiledConsole.log) { | ||
| // Using `console.log` itself might not succeed yet, but the code for it | ||
| // has been compiled. | ||
| } else { |
Member
There was a problem hiding this comment.
Can we remove this branch?
if (!compiledConsole.log) {
throw e;
}If you think it's clearer as is, no problem, ignore the comment.
Member
Author
There was a problem hiding this comment.
Thanks for pointing it out, but yes, I think it’s clearer this way.
targos
approved these changes
Aug 3, 2017
Member
bnoordhuis
approved these changes
Aug 3, 2017
|
|
||
| stream.write(string, errorhandler); | ||
| } catch (e) { | ||
| // console is a debugging utility, so it swalling errors is not desirable |
targos
pushed a commit
to targos/node
that referenced
this pull request
Aug 3, 2017
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: nodejs#14580 Fixes: nodejs/node-v8#5 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Member
|
Landed in fb3d0e2 (with fixed typo) |
refack
reviewed
Aug 3, 2017
| const console = consoleDescriptor.get(); | ||
| if (console.log) { | ||
| console.log('Hello, World!'); | ||
| compiledConsole = consoleDescriptor.get(); |
Contributor
There was a problem hiding this comment.
Could you add a check that e.message === 'Maximum call stack size exceeded' (should be assert, but we can assume the stack is full)
| // Using `console.log` itself might not succeed yet, but the code for it | ||
| // has been compiled. | ||
| } else { | ||
| throw e; |
Contributor
There was a problem hiding this comment.
IMHO you should throw a new Error, one that explicitly represents the failure to compile (could be prepared in advance if there's no room on the stack).
addaleax
added a commit
that referenced
this pull request
Aug 7, 2017
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: #14580 Fixes: nodejs/node-v8#5 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make a message test more accurate in what it’s testing for.
This requires not swallowing stack overflow RangeErrors in
console.logand similar methods, which I would consider abugfix in itself.
Fixes: nodejs/node-v8#5 (i.e. this is required for upgrading to V8 > 6.0)
/cc @targos
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
console, test