I suggest you look at how util.inherits is implemented, then use that for 
inheritance.

With regards to your code, the issue lies in your `.create` function - 
instead of doing `Object.create(this)` do 
`Object.create(ValueObject.prototype)`.
The reason you're getting the `getProperty` closure added on all the 
prototypes is because when you call your `.create`, `this` refers to an 
actual instance of ValueObject.
So right now, what ur doing is creating a new object which has an instance 
of ValueObject as it's prototype.
Since the `getProperty` closure is defined on the ValueObject constructor 
directly, it belongs to ValueObject instances rather than the ValueObject 
prototype.
This means that the new object that you're creating with `Object.create` 
will have `getProperty` in its prototype, which will result in a huge ass 
leak if your creating thousands of prototypes.

Also, don't use __proto__ as it's deprecated, use Object.getPrototypeOf 
instead.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to