« Bugzilla Issues Index

#1799 — CreateItrResultObject (value, done)

It doesn't seem that the "value" property need be present on an iterator object if the value is undefined. Likewise "done" need not be present if it is false, as undefined is falsey. Consider relaxing the specification to say "create an object in such a way that IteratorValue(result) would return value, and IteratorDone(result) would return done".

André Bargull notes in

> [Eliding value or done properties] is a bit problematic because the object created in CreateItrResultObject inherits from Object.prototype which means "value" or "done" on Object.prototype can mix up things.

Indeed. I guess the properties should always be there, unless we allow the result object to not inherit from Object.prototype.