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(visitor): check type for the underlying js object #684

Merged
merged 1 commit into from Feb 27, 2024

Conversation

kwonoj
Copy link
Contributor

@kwonoj kwonoj commented Feb 27, 2024

This PR aims to make a stopgap workaround for napi-rs/napi-rs#1641.

TL:DR, with latest napi get_named_property's Result does not ensure if it's correct type of the value or not. It can be null|undefined, causes a failure later.

PR guards for the custom visitor logic to look up each properties - check its value type, then coerce into actual value. If upstream napi fixes this behavior it can go away, but anyone uses napi version ~today can benefit by this changes still.

Copy link
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

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

thanks!

@devongovett devongovett merged commit bdf4a77 into parcel-bundler:master Feb 27, 2024
3 checks passed
@kwonoj kwonoj deleted the fix-transformer-visitor branch February 27, 2024 22:37
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.

None yet

2 participants