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

src: handle bad callback in asyc_wrap #31946

Closed

Conversation

HarshithaKP
Copy link
Member

src: handle bad callback in asyc_wrap

Align with the MaybeLocal<> API contract
Refs:

node/deps/v8/include/v8.h

Lines 345 to 349 in 9403250

* If an API method returns a MaybeLocal<>, the API method can potentially fail
* either because an exception is thrown, or because an exception is pending,
* e.g. because a previous API call threw an exception that hasn't been caught
* yet, or because a TerminateExecution exception was thrown. In that case, an
* empty MaybeLocal is returned.

addresses an @addaleax 's TODO

src: elevate v8 namespaces

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Feb 25, 2020
using v8::Name;
using v8::String;
using v8::Symbol;
using v8::Value;
Copy link
Member

Choose a reason for hiding this comment

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

We don’t add using statements to headers (we should probably have a linter rule against that, at least for the v8 symbols…)

Copy link
Member Author

Choose a reason for hiding this comment

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

@addaleax, grep "using v8::" src/*.h

I am seeing this pattern in few files already. If I remove using phrase, is there any way I can elevate ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, these other files should also not use it.

There are no shorthands in that case, we do spell out the entire type in headers.

Copy link
Member Author

Choose a reason for hiding this comment

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

@addaleax,thanks. Reverted the changes. What is the rationale for this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean, why we want to skip for headers ? Is there any performance reason or something else ?

Copy link
Member

Choose a reason for hiding this comment

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

@HarshithaKP Because then the symbols are available in any source file that includes this header, even if that’s not obvious. For example, this code would fail to compile if example.h has a using v8::Array; line:

#include "example.h"

class Array {};

src/async_wrap-inl.h Outdated Show resolved Hide resolved
src/async_wrap-inl.h Outdated Show resolved Hide resolved
Align with the MaybeLocal<> API contract
src/async_wrap-inl.h Outdated Show resolved Hide resolved
@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Mar 4, 2020
@nodejs-github-bot
Copy link
Collaborator

gireeshpunathil pushed a commit that referenced this pull request Mar 5, 2020
Align with the MaybeLocal<> API contract

PR-URL: #31946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@gireeshpunathil
Copy link
Member

landed in 757e203

MylesBorins pushed a commit that referenced this pull request Mar 9, 2020
Align with the MaybeLocal<> API contract

PR-URL: #31946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 10, 2020
codebytere pushed a commit that referenced this pull request Mar 16, 2020
Align with the MaybeLocal<> API contract

PR-URL: #31946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
codebytere pushed a commit that referenced this pull request Mar 17, 2020
Align with the MaybeLocal<> API contract

PR-URL: #31946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
@codebytere codebytere mentioned this pull request Mar 17, 2020
codebytere pushed a commit that referenced this pull request Mar 23, 2020
Align with the MaybeLocal<> API contract

PR-URL: #31946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
codebytere pushed a commit that referenced this pull request Mar 30, 2020
Align with the MaybeLocal<> API contract

PR-URL: #31946
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants