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: add SyntaxError #1326

Merged
merged 1 commit into from
Jun 16, 2023
Merged

src: add SyntaxError #1326

merged 1 commit into from
Jun 16, 2023

Conversation

KevinEady
Copy link
Contributor

Adds wrapper for Napi::SyntaxError from release of Node-API v9.

@KevinEady
Copy link
Contributor Author

KevinEady commented Jun 10, 2023

Node Version Link Status
20 https://ci.nodejs.org/job/node-test-node-addon-api-new/7558/
21 https://ci.nodejs.org/job/node-test-node-addon-api-new/7559/ ✅*

*: osx1015 failing due to #1328

@@ -0,0 +1,66 @@
# SyntaxError

Copy link
Member

Choose a reason for hiding this comment

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

Should it say here that it's only supported in node-api version 9 and higher?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so... We don't have any other node-api version information in our docs, eg. Napi::Object::Freeze() does not mention being Node-API v8 only.

Copy link
Member

Choose a reason for hiding this comment

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

That might be a gap though ? I go to try to use an API and it's not there? Either way agree that we don't need to be block this PR on it, but might be worth thinking about wether adding that info makes sense.

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 with a suggestion

Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

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

LGTM % one nit.

@@ -9,6 +9,8 @@ if (process.argv[2] === 'fatal') {

module.exports = require('./common').runTestWithBindingPath(test);

const napiVersion = Number(process.env.NAPI_VERSION ?? process.versions.napi);
Copy link
Member

Choose a reason for hiding this comment

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

It might be better to move the napiVersion definition in test/index.js to test/common/index.js so that we don't have to repeat it.

@KevinEady
Copy link
Contributor Author

Added do not land label until release of v7.0.0 is complete.

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.

3 participants