archives

« Bugzilla Issues Index

#4239 — IteratorComplete: access own property?


7.4.3 IteratorComplete ( iterResult )

This operation retrieves `done` via [[Get]]. Wouldn’t it be safer to restrict access to own properties? Otherwise, `Object.prototype.done = true` will break some code.

It may also make sense to document whether `done` is optional. Currently, nothing bad happens if you omit it (instead of specifying it as `false`). Should an exception be thrown, instead?


In general that's how all [[Get]] access work. Pointless to try to address it in just this one case.

25.1.1.3 explicitly states that 'done' need not be explicitly present.


Right. Claude Pache recently – convincingly – argued [1] that using [[Get]] has advantages, too.


[1] https://gist.github.com/rauschma/73e5f86a595b7709f39e#comment-1422556