kolodny / es-lab

Automatically exported from code.google.com/p/es-lab
0 stars 0 forks source link

Can't instantiate traits with accessor properties on latest node.js #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
// tried on node v0.2.4
var Trait = require('traits').Trait;
var t = Trait({ get foo() { return 42; } });
var o = Trait.create(Object.prototype, t);

>TypeError: Invalid property.  A property cannot both have accessors and be 
writable or have a value: #<an Object>

Original issue reported on code.google.com by tvcut...@gmail.com on 3 Nov 2010 at 7:48

GoogleCodeExporter commented 8 years ago
The problem was that Trait.create assigned a 'writable' attribute to accessor 
properties. Fixed in r477.

Original comment by tvcut...@gmail.com on 3 Nov 2010 at 7:49

GoogleCodeExporter commented 8 years ago

Original comment by tvcut...@gmail.com on 3 Nov 2010 at 7:49