Should a JS engine retain a reference to the original value of well-known symbols (like Symbol.iterator), or should steps that use well-known-Symbol-valued properties (like for..of iteration) always do a dynamic lookup on that value?
http://jsfiddle.net/hzzo10dm/2/ is a proof of concept that demonstrates in Chrome 40 that by replacing Symbol.iterator with another symbol, I can create some weird behavior. What is specified to happen to built-in and custom iterables if I do `Symbol.iterator = Symbol()`? What I would expect is that either: - the original value of Symbol.iterator would forever be the only value in a realm that could be used to provide an iterator - or, that whatever the current value of Symbol.iterator, at that moment that would be the only way to retrieve an iterator on an object, thus overwriting Symbol.iterator should break all iteration.
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

