zsogolow / entitizejs

A JavaScript library that helps turn domain models into rich JavaScript objects
MIT License
0 stars 1 forks source link

Investigate JEntity constructor #2

Open zsogolow opened 8 years ago

zsogolow commented 8 years ago

Determine if explicitly setting obj.proto is okay to do, or how this can be done differently to set up the correct proto chain

zsogolow commented 8 years ago

JEntity.prototype = EntitizeNamespace.types[entitytype]; JEntity.prototype.constructor = EntitizeNamespace.types[entitytype].constructor; before invoking new JEntity() ... Or explicitly setting obj.proto at the end of creating the new JEntity

Both have the same outcome... As far as I know.