[Framework] Add spec for partial constructor

Add spec for partial constructor, used to handle two-stage
application of Angular dependencies and constructor
arguments. WTD-518.
This commit is contained in:
Victor Woeltjen
2014-11-06 17:09:32 -08:00
parent b0267a9c59
commit 5d4f1f2008
2 changed files with 56 additions and 5 deletions

View File

@ -31,14 +31,13 @@ define(
return function () { // Bind everything else
var other = Array.prototype.slice.call(arguments),
instance = {};
instance = Object.create(Constructor.prototype);
// Mimic "new" behavior with apply.
instance = Constructor.apply(
instance,
dependencies.concat(other)
) || instance;
instance.prototype = Constructor.prototype;
return instance;
};