Skip to content

Conversation

@alexandre-abrioux
Copy link
Contributor

This PR fixes setting a falsy value on a proxyfied object. Without the fix, the test fails with the following error when running proxy.booleanTest = false:

'set' on proxy: trap returned falsish for property 'booleanTest'

This behavior is documented here on MDN:

If the set() method returns false, and the assignment happened in strict-mode code, a TypeError will be thrown.

Copy link
Owner

@Papooch Papooch left a comment

Choose a reason for hiding this comment

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

Great catch, thank you! But please move the test case to packages/core/test/proxy-providers/proxy-providers.spec.ts to a new top-level describe block called "edge cases".

@alexandre-abrioux
Copy link
Contributor Author

@Papooch Thanks! Done in 1623c21

@Papooch Papooch changed the title fix(proxy-provider-manager): handle setting falsy value fix(core): handle setting falsy value in proxy providers Jan 31, 2024
@Papooch Papooch merged commit 26737d8 into Papooch:main Jan 31, 2024
@Papooch
Copy link
Owner

Papooch commented Jan 31, 2024

Released in 4.0.3

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.

2 participants