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

Figure out how to allow setting properties without falling of spec'd path #9

bakkot opened this issue Aug 5, 2019 · 1 comment


Copy link

commented Aug 5, 2019

Current spec text says

the iterator must behave as if it were the iterator given by CreateForInIterator ( O ) until either O or an object in its prototype chain has its [[SetPrototypeOf]], [[DefineOwnProperty]], or [[Delete]] internal method invoked

Unfortunately, the [[DefineOwnProperty]] method is triggered during OrdinarySet, both when updating an existing own property and when setting a new property. That means the spec text, as written, allows engines to do whatever they want as soon as sets or updates a property on the object or its prototype. And that means that one of the real constraints is not captured, namely, "properties which are added to the base object being iterated after iteration begins are not returned".

I (or someone) should figure out how to avoid this. Maybe it is possible to say something like "[[DefineOwnProperty]], except when called via OrdinarySet on O"?


This comment has been minimized.

Copy link
Collaborator Author

commented Aug 22, 2019

This is a duplicate of #6 (and nearly word-for-word identical). Both of which were filed by me. Good job, me.

@bakkot bakkot closed this Aug 22, 2019

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