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

Covering the write-to-property common case #6

Open
bakkot opened this issue Jun 4, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@bakkot
Copy link
Collaborator

commented Jun 4, 2019

Current proposed spec text says

the iterator must behave [...] until either O or an object in its prototype chain has its [[SetPrototypeOf]], [[DefineOwnProperty]], or [[Delete]] internal method invoked

Unfortunately, [[DefineOwnProperty]] is invoked even if you're just doing an ordinary write to an existing enumerable data property. I'd like to put that in the deterministic case. One idea: say

its [[SetPrototypeOf]], [[Delete]], or [[DefineOwnProperty]] internal method invoked, except if [[DefineOwnProperty]] was invoked as step 3.d.iv of OrdinarySetWithOwnDescriptor

That could be expanded to include the case where an property is added to the object being iterated (but not a property added to its prototype) by saying

its [[SetPrototypeOf]], [[Delete]], or [[DefineOwnProperty]] internal method invoked, except if [[DefineOwnProperty]] was invoked in step 3.d.iv of OrdinarySetWithOwnDescriptor or if [[DefineOwnProperty]] was invoked with receiver O in step 3.e.ii of OrdinarySetWithOwnDescriptor

but that's getting really ugly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.