archives

« Bugzilla Issues Index

#3781 — 13.6.4.13 ForIn/OfBodyEvaluation: Perform IteratorClose in 5.a - 5.g ?


13.6.4.13 Runtime Semantics: ForIn/OfBodyEvaluation

The newly added IteratorClose calls in destructuring forms, collections etc. call IteratorClose even if the iterator itself throws an exception. Contrary to that 13.6.4.13 only calls IteratorClose when an abrupt completion occurs in step 5.h-i or in 5.k.

Are these differences in the semantics intentional?


fixed in rev33 editor's draft

I was being overly aggressive in classing IteratorClose.

IteratorClose should not be called if the iterator has normally reached its end or for exceptions that originated from the iterator.

In particular we shouldn't call the IteratorClose for exceptions that are received via IteratorStep IteratorNext, IteratorConplete, IteratorValue

I fixed Array destructuring and the built-ins to conform to this rule.


fixed in rev33