« Bugzilla Issues Index
#4239 — IteratorComplete: access own property?
- bug_id:
4239
- creation_ts:
2015-03-27 08:33:00 -0700
- short_desc:
IteratorComplete: access own property?
- delta_ts:
2015-04-01 10:53:25 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 35: March 4, 2015 Release Candidate 2
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
WONTFIX
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
Axel Rauschmayer
- assigned_to:
Allen Wirfs-Brock
- commentid:
13956
- comment_count:
0
- who:
Axel Rauschmayer
- bug_when:
2015-03-27 08:33:41 -0700
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?
- commentid:
13990
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2015-04-01 10:45:02 -0700
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.
- commentid:
13992
- comment_count:
2
- who:
Axel Rauschmayer
- bug_when:
2015-04-01 10:53:25 -0700
Right. Claude Pache recently – convincingly – argued [1] that using [[Get]] has advantages, too.
[1] https://gist.github.com/rauschma/73e5f86a595b7709f39e#comment-1422556