feat: port test_cannot_run_js to CTS#1
Closed
kraenhansen wants to merge 2 commits intofeat/easy-js-native-api-testsfrom
Closed
feat: port test_cannot_run_js to CTS#1kraenhansen wants to merge 2 commits intofeat/easy-js-native-api-testsfrom
kraenhansen wants to merge 2 commits intofeat/easy-js-native-api-testsfrom
Conversation
Builds two addons from the same C source with different NAPI_VERSION defines (10 and 9) to verify that finalizers attempting to access JS during shutdown receive napi_cannot_run_js or napi_pending_exception (respectively), or napi_ok if the event loop is still running. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Closing in favour of a PR against the upstream nodejs/node-api-cts repo. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
This PR is stacked on nodejs#25 and should not be reviewed or merged until that PR lands.
Summary
test_cannot_run_jsfromnode/test/js-native-api/to the CTStest_cannot_run_jswithNAPI_VERSION=10,test_pending_exceptionwithNAPI_VERSION=9) to cover both code paths in the finalizernapi_get_named_propertyreturnsnapi_cannot_run_js(v10+),napi_pending_exception(v9), ornapi_okif the event loop is still runningTest plan
npm run addons:configure && npm run addons:build— both addons compile cleanlynpm run node:test— all 48 tests pass, includingtest_cannot_run_js🤖 Generated with Claude Code