Fix throwJSException in JSI for Node-API #232
Merged
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.
Lately the stack overflow JSI test that runs JSI implementation for Node-API was failing.
The initial fix in PR #221 introduced a crash where in the
isInstanceOfmethod we take a value from thevm::CallResult<bool>even if it has an error.The crash became visible when started to use Clang compiler.
The more detailed analysis had shown that JSI for Node-API error reporting is significantly different from the base JSI implementation for Hermes. We must no use the
isInstanceOfmethod at all.In this PR we:
throwJSExceptionso that it follows the JSI for Hermes implementation;isInstanceOfmethod.As a result the stack overflow test is passing.