Skip to content

fix(visitor): check type for the underlying js object#1

Closed
kwonoj wants to merge 1 commit intomasterfrom
fix-transformer-visitor
Closed

fix(visitor): check type for the underlying js object#1
kwonoj wants to merge 1 commit intomasterfrom
fix-transformer-visitor

Conversation

@kwonoj
Copy link
Owner

@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.

@kwonoj kwonoj closed this Feb 27, 2024
@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.

1 participant