worker: handle exception when creating execArgv errors#27245
Closed
addaleax wants to merge 2 commits intonodejs:masterfrom
Closed
worker: handle exception when creating execArgv errors#27245addaleax wants to merge 2 commits intonodejs:masterfrom
addaleax wants to merge 2 commits intonodejs:masterfrom
Conversation
Handle possible JS exceptions that can occur by returning to JS land immediately. The motivation for this change is that `USE(….FromJust());` is an anti-pattern, and `.FromJust()` with an unused return value is superseded by `.Check()`. However, in this case, checking that the operation succeeded is not necessary. Refs: nodejs#27162
Collaborator
bnoordhuis
approved these changes
Apr 16, 2019
| Local<String> key = | ||
| FIXED_ONE_BYTE_STRING(env->isolate(), "invalidExecArgv"); | ||
| USE(args.This()->Set(env->context(), key, error).FromJust()); | ||
| USE(args.This()->Set(env->context(), key, error)); |
Member
There was a problem hiding this comment.
Maybe add an explaining comment here? I bet it's going to look wrong to the casual reader otherwise.
Collaborator
jasnell
approved these changes
Apr 16, 2019
addaleax
added a commit
that referenced
this pull request
Apr 17, 2019
Handle possible JS exceptions that can occur by returning to JS land immediately. The motivation for this change is that `USE(….FromJust());` is an anti-pattern, and `.FromJust()` with an unused return value is superseded by `.Check()`. However, in this case, checking that the operation succeeded is not necessary. Refs: #27162 PR-URL: #27245 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
Author
|
Landed in 002dacb |
This was referenced Apr 23, 2019
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.
Handle possible JS exceptions that can occur by returning to JS land
immediately.
The motivation for this change is that
USE(….FromJust());is ananti-pattern, and
.FromJust()with an unused return value issuperseded by
.Check(). However, in this case, checking that theoperation succeeded is not necessary.
Refs: #27162
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes