On Feb 19, 2015, at 1:13 PM, Mark S. Miller wrote:

> 
> 
> On Thu, Feb 19, 2015 at 12:56 PM, Allen Wirfs-Brock <[email protected]> 
> wrote:
> 
> On Feb 19, 2015, at 12:09 PM, Andrea Giammarchi wrote:
> 
> > if we'd like to have Array.empty, Function.empty, String.empty and friends, 
> > what's wrong with having these as we always had already: as prototypes?
> 
> Just to keep things focused. *.empty is not something that is on the table 
> for ES6.  It would have to go into the ES7 track.
> 
> Today's issue, is
> 
> 1) do we need to revert Array.prototype to being an Array exotic object
> (I think we do)
> 
> 2) do we need to revert RegExp.prototype to being a RegExp instance.(with 
> initialize RegExp internal slots)
> (maybe not, and alternatively I have very minor tweaks to the exec and test 
> methods that will maintain the most likely such legacy RegExp.prototype uses 
> without needing those internal slots)
> 
> RegExp.prototype.compile 
> https://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.compile
>  is a visible side effect that survives Object.freeze. It is only not a 
> global communications channel because there is no longer a primordial RegExp 
> instance. So we cannot consider making RegExp.prototype a RegExp unless 
> Object.freeze must disable RegExp.prototype.compile on RegExp instances.

Good. I alwasys remember Date.prototype but tend to forget about compile.

I think we can keep RegExp as a plain vanilla object (RegExp instances are 
ordinary, but not plain vanilla) and still have good enough legacy compat for 
RegExp "misuse" via my exec and test tweaks.  (they basically just test if they 
are being called with %RegExpProtoype% as their this object. Doesn't catch 
cross-realm, but probably still good enough)

Allen

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

Reply via email to