Dean Landolt wrote:
I'd hate to see it throw. Ignoring lastIndex seems friendlier,
especially if it were called `execAll`. It probably shouldn't be
called `execIter` considering `exec` is already an iterator (even if a
bit crazy).
'exec' is not an iterator in any well-defined ES6 sense.
Yes, ok -- I blew it by trying to emulate Perl 4. The jargon there was
"list" vs "scalar" context, not "iterator".
I'd love to be able to `send` a specific index to the generator, which
would be completely equivalent to `RegExp.prototype.exec` without the
lastIndex smell.
Why an index? Rarely have I seen anyone assign other than constant 0 to
lastIndex.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss