> I suggest you look at how util.inherits is implemented, then use that
> for inheritance.
I know that is a better idea, which keeps constructor and super_
properties, but it hides the fact that in JavaScript you use
Object.create() even for classical inheritance.


> With regards to your code, the issue lies in your `.create` function -
> instead of doing `Object.create(this)` do
> `Object.create(ValueObject.prototype)`. [...]
Thank you for explaining me my own code, that is not the issue. Your
proposition kills all the magic possible at runtime later, the bind()
solution I proposed handels this better...

> Also, don't use __proto__ as it's deprecated, use
> Object.getPrototypeOf instead.
Good that you mention this, that's also a good replacement for a custom
"super" field.

-- 
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