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

scopes: make failure of closing scopes fatal #566

Closed
wants to merge 1 commit into from

Conversation

legendecas
Copy link
Member

But not ignoring these failures.

But not ignoring these failures.
@mhdawson
Copy link
Member

Can you give some context on how this would affect existing code.

For example, is it going to fail out already just with a poorer stack trace/info or is this potentially going to break some existing code?

@legendecas
Copy link
Member Author

I don't think it would affect the existing working code. Yet it would be helpful to debug possibly misusage of Napi::HandleScopes like:

Value doubleCloseScope(const CallbackInfo& info) {
  Env env = info.Env();
  HandleScope scope(env);
  HandleScope scope2 = scope; // this one would be closed with status `napi_handle_scope_mismatch` silently
  return env.Undefined();
}

@mhdawson
Copy link
Member

@gabrielschulhof if you agree it's unlikely to affect working code I'm ok with it.

@mhdawson
Copy link
Member

mhdawson commented Oct 21, 2019

Discussion in N-API team meeting today was that this is directly related to #565. We don't believe that the close should fail except for the case where it had been copied which will no longer be possible.

Copy link
Member

@NickNaso NickNaso left a comment

Choose a reason for hiding this comment

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

LGTM

@mhdawson
Copy link
Member

We did discuss and this should land as a SemVer major even though it should not affect any existing code.

@NickNaso NickNaso mentioned this pull request Oct 22, 2019
15 tasks
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

mhdawson pushed a commit that referenced this pull request Oct 23, 2019
Properly handle failures instead of ignoring them.

PR-URL: #566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
@mhdawson
Copy link
Member

Landed as ce139a0

@mhdawson mhdawson closed this Oct 23, 2019
mhdawson pushed a commit that referenced this pull request Oct 23, 2019
PR-URL: #566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
@legendecas legendecas deleted the fatal-error branch October 28, 2019 14:05
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
Properly handle failures instead of ignoring them.

PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
Properly handle failures instead of ignoring them.

PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
Properly handle failures instead of ignoring them.

PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
Properly handle failures instead of ignoring them.

PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
PR-URL: nodejs/node-addon-api#566
Reviewed-By: NickNaso <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gabriel Schulhof <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants