-
Notifications
You must be signed in to change notification settings - Fork 176
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
throw TypeError in strict mode if set trap doesn't return true #10
Comments
I can give it a shot. I plan to use the same strictMode check that @samthor posted. I am not aware of any edge cases where it would fail, but I could be mistaken. I noticed that the specs don't seem to define a specific TypeError message for this case. Any preference there? I'm imagining something along the lines of 'handler.set: Assignment failed in strict mode'. |
Working out whether the caller is in strict mode is never going to happen. I'd probably add an option to the polyfill constructor to run in strict mode, to throw an Error if there's a problem. |
There’s a possible way to do this using |
See MDN.
This code will work inside the calling code, but that's not really what we want:
For eager contributors: I want to point out that we need to work out whether the caller is in strict mode (not the proxy code itself). This is possible under some very limited circumstances, but not always. I suspect this issue is unsolvable.
The text was updated successfully, but these errors were encountered: