classes and enumerability

Glen Huang curvedmark at gmail.com
Tue Dec 23 21:57:14 PST 2014


How?

Given that you don’t know the names of the prototype properties and methods contained (could be deep in the prototype chain) in a object. How do you add these to another object?

> On Dec 24, 2014, at 1:50 PM, Gary Guo <nbdd0121 at hotmail.com> wrote:
> 
> Object.defineProperty could easily do that.
> 
> >From: curvedmark at gmail.com <mailto:curvedmark at gmail.com>
> >Date: Wed, 24 Dec 2014 13:33:24 +0800
> >
> >Although I guess it’s not very easy to desugar to es5 if there is no way to enumerate prototype methods/properties. (probably impossible?)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141224/55628dab/attachment.html>


More information about the es-discuss mailing list