C. Scott Ananian wrote:
On Wed, Sep 24, 2014 at 2:36 AM, Viktor Mukhachev<[email protected]>  wrote:
>  RegExp.prototype.exec returns array with extra properties (input, index), 
may be it is better to return something other for `run`, frozen value object with 
`0`, `1`, ...  keys for example. What do you think?

For ES6 this can return a proper subclass of Array.

Adding a new method still leaves the old ones around and developers will have problems until some later date. Doesn't mean we shouldn't, but in the mean time the API surface grows. Is it worth it compared to the alternatives?

1. Support configurable as an attribute on the magic, not-yet-specified RegExp statics, so they can be deleted. SES (Caja) wants this, others could use it, libraries could do it at startup.

2. Add a RegExp instance flag (don't overload u) that disables updating the RegExp statics.

TC39 wants both of these, per today's meeting.

>  Actually, `index` and "input" are not very interesting, as input is a string 
passed to `exec` and index = string.indexOf(match[0], lastIndex), right?

Not in the presence of lookahead assertions.

Good point!

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to