« Bugzilla Issues Index
#3244 — 13.6.4.9 ForIn/OfBodyEvaluation: Skip IteratorClose in for-in statement loop?
- bug_id:
3244
- creation_ts:
2014-09-19 09:26:00 -0700
- short_desc:
13.6.4.9 ForIn/OfBodyEvaluation: Skip IteratorClose in for-in statement loop?
- delta_ts:
2014-09-21 14:44:26 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 27: August 24, 2014 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
INVALID
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
André Bargull
- assigned_to:
Allen Wirfs-Brock
- commentid:
10211
- comment_count:
0
- who:
André Bargull
- bug_when:
2014-09-19 09:26:59 -0700
13.6.4.9 Runtime Semantics: ForIn/OfBodyEvaluation
for-in loop iteration currently also calls IteratorClose, is this intentional?
- commentid:
10232
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2014-09-21 12:17:37 -0700
Yes. Is there any reason it shouldn't? The [[Enumerate]] internal method returns an iterator that could have a 'close' method.
- commentid:
10235
- comment_count:
2
- who:
André Bargull
- bug_when:
2014-09-21 13:37:50 -0700
I didn't see any mentions of for-in loops in discussions about the 'return' method proposal on es-discuss or in the tc39-notes, so I figured it makes sense to ask about this. But maybe I've just overlooked something.
Resolving as 'Invalid'.
- commentid:
10237
- comment_count:
3
- who:
Allen Wirfs-Brock
- bug_when:
2014-09-21 14:44:26 -0700
It's really more about the fact that an iterator is used, rather than the syntax of the loop.
The basic idea, is that if an iterator-based loop exits before exhausting the iterator it should invoke 'return' (if it exists) on the iterator to allow the iterator to do any cleanup it needs.