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

fix: missing node_api_nogc_env definition #1585

Merged
merged 2 commits into from
Oct 8, 2024
Merged

Conversation

legendecas
Copy link
Member

@legendecas legendecas commented Oct 4, 2024

Fixes: #1584

Add GitHub Actions for node-api-headers compatibility test, covering old Node.js versions. node-api-headers strips experimental apis so only test with stable NAPI_VERSION.

As there was no feature detection defs for node_api_basic_finalize or node_api_basic_env, use NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER for feature detection since it was introduced about the time where node_api_basic_env/node_api_nogc_env was introduced.

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.42%. Comparing base (d8523a7) to head (0f1f7e6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1585   +/-   ##
=======================================
  Coverage   64.42%   64.42%           
=======================================
  Files           3        3           
  Lines        2010     2010           
  Branches      699      699           
=======================================
  Hits         1295     1295           
  Misses        147      147           
  Partials      568      568           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

napi.h Outdated
#if NAPI_VERSION > 5
template <typename T>
static void DefaultFini(Env, T* data);
template <typename DataType, typename HintType>
static void DefaultFiniWithHint(Env, DataType* data, HintType* hint);
#endif // NAPI_VERSION > 5
public:
BasicEnv(node_api_nogc_env env);
BasicEnv(node_addon_api_basic_env env);
#ifdef NODE_API_EXPERIMENTAL_HAS_POST_FINALIZER
Copy link
Contributor

Choose a reason for hiding this comment

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

In the node-addon-api meeting on 4 Oct, we discussed that it should be possible just to have a operator to node_addon_api_basic_env and node_addon_api_basic_finalize, as the compiler will allow conversion from BasicEnv -> node_addon_api_basic_env -> node_api_nogc_env or napi_env depending on options allowed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, ptal again, thanks

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

Copy link
Contributor

@KevinEady KevinEady left a comment

Choose a reason for hiding this comment

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

LGTM

@legendecas legendecas merged commit 6ba3891 into nodejs:main Oct 8, 2024
54 checks passed
@legendecas legendecas deleted the compat branch October 8, 2024 23:20
@github-actions github-actions bot mentioned this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Upgrading from v8.1.0 to v8.2.0 breaks compilation
5 participants