Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upresult of "return" method in IteratorClose #294
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Jan 18, 2016
Member
It's defined by user code, so it might return a primitive - and given that it's an iterator result, its return value must conform with the contract. See step 3 in http://tc39.github.io/ecma262/#sec-iteratornext and step 1 in http://tc39.github.io/ecma262/#sec-iteratorcomplete and http://tc39.github.io/ecma262/#sec-iteratorvalue.
|
It's defined by user code, so it might return a primitive - and given that it's an iterator result, its return value must conform with the contract. See step 3 in http://tc39.github.io/ecma262/#sec-iteratornext and step 1 in http://tc39.github.io/ecma262/#sec-iteratorcomplete and http://tc39.github.io/ecma262/#sec-iteratorvalue. |
GeorgNeis commentedJan 18, 2016
7.4.6 IteratorClose enforces that the result of the return method is an object:
This seems strange as the result is not used. What's the reason for this check?