Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
✨ Allow ES6 classes
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinroger authored Apr 11, 2017
1 parent 2a45edd commit 192d16f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scientist.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ exports.create = function(/* constructor, ...constructorArgs */) {
var machine;

if (constructor.prototype) {
machine = Object.create(constructor.prototype);
machine.constructor.apply(machine, constructorArgs);
machine = new (Function.prototype.bind.apply(constructor, [null].concat(constructorArgs)));
} else if (constructor.init) {
machine = constructor;
}
Expand Down

0 comments on commit 192d16f

Please sign in to comment.