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

Open
samthor opened this Issue Mar 27, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@samthor
Member

samthor commented Mar 27, 2016

let strictMode = (function() { return !this; })();

See MDN.

@samthor

This comment has been minimized.

Member

samthor commented Mar 27, 2016

We need to be able to work out whether the calling code is in strict mode. It's possible under some limited circumstances, but seemingly not always.

@studentIvan

This comment has been minimized.

studentIvan commented Nov 1, 2016

+1

@Nathan-Schwartz

This comment has been minimized.

Nathan-Schwartz commented Nov 2, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment