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.

On Oct 5, 2011 11:59 PM, "John J Barton" <[email protected]>
wrote:



On Tue, Oct 4, 2011 at 8:56 PM, John J Barton <[email protected]>
wrote: > > In trying to ...

Ok that was a quick experiment. I completely misunderstood Object.create().
I imagined that Object.create(a,b) returned an object with the properties of
b and a __proto__ of a. Unfortunately the second argument is some kind of
meta object. So to get {p:42} you have to write { p: { value: 42, writable:
true, enumerable: true, configurable: true } }. Oy vey.

jjb

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

Reply via email to