On 2007-07-09, at 19:16 EDT, Brendan Eich wrote:
> Having thought about 1 more, I'd like to point out that it's *not*
> what ES3 does:
>
> js> function F(){}
> js> F.prototype = d = new Date
> js> f = new F
> js> f.__proto__ === d
> true
> js> f.setTime(0)
> typein:10: TypeError: Date.prototype.setTime called on incompatible
> Object
>
> So new F did create an Object instance, and it linked its __proto__
> (ES1-3 [[Prototype]] internal property) to d. Not what Kris
> proposes by analogy to ES1-3, so I'm favoring 2 at the moment.
[Coming late to the party]
And it has burned me that I could not do that. I wanted to write an
'annotated string' and couldn't because of exactly this restriction.
Will I be able to subclass built-in types? Or will their methods be
hard-wired in some way that raises similar issues?
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss