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

[WIP] feat(napi): add napi-fatal-exception #2054

Merged
merged 2 commits into from
Feb 12, 2023

Conversation

ThatOneBro
Copy link
Contributor

@ThatOneBro ThatOneBro commented Feb 12, 2023

Fixes #2053 , needs to be tested first

@Jarred-Sumner
Copy link
Collaborator

needs to be referenced in this function:

https://github.com/oven-sh/bun/blob/jarred/new-bundler/src/napi/napi.zig#L1440-L1446

then, needs to be added to this list:

https://github.com/oven-sh/bun/blob/jarred/new-bundler/src/symbols.txt#L140

auto globalObject = toJS(env);
JSC::JSValue value = JSC::JSValue::decode(reinterpret_cast<JSC::EncodedJSValue>(err));
JSC::JSObject* obj = value.getObject();
if (UNLIKELY(obj == nullptr || !obj->isErrorInstance())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is a subtle difference between an exception and an error and I'm not sure this satisfies that

Copy link
Collaborator

Choose a reason for hiding this comment

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

But I'm also not sure if the value passed here is expected to be a JSC::Exception

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can merge this since its better than the present state regardless

@Jarred-Sumner Jarred-Sumner marked this pull request as ready for review February 12, 2023 04:20
@Jarred-Sumner Jarred-Sumner merged commit 9eba1e0 into main Feb 12, 2023
@Jarred-Sumner Jarred-Sumner deleted the derrick/feat/add-napi-fatal-exception branch February 12, 2023 04:20
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.

nodejs-polars fails on supported NAPI function
2 participants