babel/lib/6to5/templates/apply-constructor.js
2014-11-23 01:16:09 +11:00

6 lines
248 B
JavaScript

(function (Constructor, args) {
var instance = Object.create(Constructor.prototype);
var result = Constructor.apply(instance, args);
return result != null && (typeof result == "object" || typeof result == "function") ? result : instance;
});