ES3.1 Object static methods rationale document

Kris Zyp kris at sitepen.com
Wed Jul 16 22:14:30 PDT 2008


>> Arguably, some of the need for direct prototype access is
>> alleviated by providing the clone method.  However, there are still
>> plenty of other situations where it is useful.
>
> I observe that __proto__ in SpiderMonkey- and Rhino-based JS is
> mostly used for cases covered by Object.create, with a minority use-
> case that we've discussed before initializing it to null in object
> initialisers to make maps (dictionaries).

I am curious how Object.create covers this __proto__ use case of making 
objects with a defined proto. Doesn't Object.create create a new object and 
copy properties over? __proto__ allows objects with existing properties to 
have their proto defined in constant time, but isn't Object.create still 
O(n), with n being the number of properties?

Kris 




More information about the Es4-discuss mailing list