Skip to content

Conversation

@SergioRZMasson
Copy link
Contributor

The include for exception need to be done after NAPI_CPP_EXCEPTIONS gets defined.

@SergioRZMasson SergioRZMasson merged commit b6a77b3 into BabylonJS:main Jul 10, 2025
16 checks passed
@bghgary
Copy link
Contributor

bghgary commented Jul 10, 2025

Is this a problem in the napi.h from node?

@SergioRZMasson
Copy link
Contributor Author

Is this a problem in the napi.h from node?

I don't think so. We added:

#ifdef NAPI_CPP_EXCEPTIONS
  // [BABYLON-NATIVE-ADDITION]
  static Error New(napi_env env, const std::exception& exception);
  // [BABYLON-NATIVE-ADDITION]
  static Error New(napi_env env, const std::exception_ptr& exception_ptr);
#endif  // NAPI_CPP_EXCEPTIONS

This brings std::exception and std::exception_ptr to the file. Therefore we need to include

@bghgary
Copy link
Contributor

bghgary commented Jul 10, 2025

Is this a problem in the napi.h from node?

I don't think so. We added:

#ifdef NAPI_CPP_EXCEPTIONS
  // [BABYLON-NATIVE-ADDITION]
  static Error New(napi_env env, const std::exception& exception);
  // [BABYLON-NATIVE-ADDITION]
  static Error New(napi_env env, const std::exception_ptr& exception_ptr);
#endif  // NAPI_CPP_EXCEPTIONS

This brings std::exception and std::exception_ptr to the file. Therefore we need to include

We should wrap any changes to this file with // [BABYLON-NATIVE-ADDITION]

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