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

Commit

Permalink
Merge pull request #7 from marvinroger/master
Browse files Browse the repository at this point in the history
✨ Allow ES6 classes
  • Loading branch information
AdamMagaluk authored Apr 12, 2017
2 parents 2a45edd + 192d16f commit ab4bc60
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 ab4bc60

Please sign in to comment.