>> What’s the use case?
> 
> I thought I gave a pretty reasonable one before, but just in case:

Thanks! Shorter is better... ;-)

> In YUI, it’s impossible to use this otherwise-useful pattern:
> ---------
> var base_config = { width: "600px" };
> …
> var my_config = Object.create(base_config);
> my_config.visible = false;
> var widget = new Y.Widget(my_config);
> ---------
> In the example above, YUI will not see the “width” property because
> YUI rejects all inherited properties when it iterates through the
> configuration hash.


Got it, you want to non-destructively modify base_config. It is kind of tricky 
to know when to stop traversing the prototype chain, so the more 
straightforward solution is to make a copy and modify there or to 
non-destructively merge:

https://developer.yahoo.com/yui/3/examples/yui/yui-merge.html

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



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

Reply via email to