On Jun 21, 2011, at 9:55 PM, Brendan Eich wrote:

> One thing I'm not sure about: whether Object.defineMethod should mutate 
> C.prototype.foo's internal property, or make a new function object with a 
> different 'super' binding.

I'm still thinking about this but I'm leaning towards specifying that 
defineMethod creates a new function and leave it up to implementations to 
optimize trivial cases where that is unnecessary like:
   Object.defineMethod(obj, "foo", function () {super.foo()});

Also, Object.defineProperty used to define a accessor property get or set 
function probably should also have this semantics.  Because 'super' is new that 
seems like an upwards compatible extension.

Allen
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to