mariocasciaro / scatter

IoC container and out-of-the-box extensibility for Node.js applications
MIT License
154 stars 14 forks source link

Support instantiating ES6 classes #35

Closed simonihmig closed 8 years ago

simonihmig commented 8 years ago

When exporting a ES6 class (constructor), natively supported unter node.js 4.x/5.x, upon instantiation you get the exception "TypeError: Class constructors cannot be invoked without 'new'", because of the indirect instantiation in utils.applyConstruct. This fixes it by directly invoked the constructor with new.

mariocasciaro commented 8 years ago

Cheers, nice PR :+1: