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

TypeError in strict mode #139

Merged
merged 1 commit into from
Jan 26, 2020
Merged

Conversation

SimoTod
Copy link
Collaborator

@SimoTod SimoTod commented Jan 25, 2020

Closes #132

When javascript runs in strict mode and there is an assignment when the reactivity is suspended (for example, using x-init), the proxy returns an error as per documentation:

The set method should return a boolean value. 
Return true to indicate that assignment succeeded. 
If the set method returns false, and the assignment happened 
in strict-mode code, a TypeError will be thrown.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set#Return_value

Here's a codepen to reproduce the issue: https://codepen.io/SimoTod/pen/ZEYPrdQ

@calebporzio
Copy link
Collaborator

Great, thank you!

@calebporzio calebporzio merged commit 6a8da3a into alpinejs:master Jan 26, 2020
@SimoTod SimoTod deleted the bug/strict-mode branch November 20, 2021 00:25
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.

TypeError: proxy set handler returned false for property
2 participants