worker: handle exception when creating execArgv errors by addaleax · Pull Request #27245 · nodejs/node (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation5 Commits2 Checks0 Files changed

Conversation

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

[ Show hidden characters]({{ revealButtonHref }})

addaleax

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

Checklist

@addaleax

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

@nodejs-github-bot

@nodejs-github-bot nodejs-github-bot added c++

Issues and PRs that require attention from people who are familiar with C++.

worker

Issues and PRs related to Worker support.

labels

Apr 15, 2019

bnoordhuis

Local 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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add an explaining comment here? I bet it's going to look wrong to the casual reader otherwise.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, added a comment!

@addaleax

@nodejs-github-bot

jasnell

addaleax added a commit that referenced this pull request

Apr 17, 2019

@addaleax

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

@addaleax

This was referenced

Apr 23, 2019

Labels

c++

Issues and PRs that require attention from people who are familiar with C++.

worker

Issues and PRs related to Worker support.