On Wed, Oct 5, 2011 at 8:02 PM, Juan Ignacio Dopazo
<[email protected]>wrote:

> On Wed, Oct 5, 2011 at 10:36 PM, Jake Verbaten <[email protected]> wrote:
>
>> Object.create does indeed require  propertydescriptors as the second
>> argument. This is the easiest way to send meta-data like read-only.
>>
>> However it's verbose and the defaults are restrictive. I've written a
>> small library (github.com/Raynos/pd) to make it less verbose, you might
>> find it useful.
>>
>>
>> That's what 
>> Object.getOwnPropertyDescriptors<http://wiki.ecmascript.org/doku.php?id=strawman:extended_object_api>
>>  would
> be for. I don't know why it hasn't gotten into Harmony yet.


Sorry I the property descriptors thing is just for library writers I guess,
it's too complicated for app devs.

I think what's missing is Object.extend:

http://www.prototypejs.org/api/object/extend
http://api.jquery.com/jQuery.extend/
http://dojotoolkit.org/reference-guide/dojo/extend.html
http://docs.sencha.com/ext-js/4-0/source/Object2.html#Ext-Object-method-merge
http://code.google.com/p/fbug/source/browse/branches/firebug1.9/content/firebug/lib/object.js

just some examples in a few minutes. With extend, then we can write

var bar = Object.extend(Object.create(aMethodList), aPropList);

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

Reply via email to