Skip to content

Execution in pending exception state #122

Description

@jasongin

NAPI currently has a policy that any API call during a pending-exeption state will bail out immediately with a napi_pending_exception error. That policy is too restrictive.

It is often necessary for native modules to do some cleanup operations while in a pending-exception state. Most commonly they may need to close a handle scope. But also other things like releasing/deleting a reference should be allowed. I'm not sure about setting a property on an object (to an error state)... we should probably block anything that has a chance of re-entering JS code.

The node-sass module has pretty good unit test coverage of error conditions, and a few of those error tests are hitting this problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions