[Framework] Fix partial constructor

Fix the replicated behavior of the new operator in the
partial constructor such that it accepts factory-style
constructors (which will be the norm according to
current code style standards.) WTD-518.
This commit is contained in:
Victor Woeltjen 2014-11-05 14:04:24 -08:00
parent 2f0ea19750
commit b1654f7034

View File

@ -33,7 +33,11 @@ define(
var other = Array.prototype.slice.call(arguments),
instance = {};
Constructor.apply(instance, dependencies.concat(other));
// Mimic "new" behavior with apply.
instance = Constructor.apply(
instance,
dependencies.concat(other)
) || instance;
instance.prototype = Constructor.prototype;
return instance;