[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:
@@ -33,7 +33,11 @@ define(
|
|||||||
var other = Array.prototype.slice.call(arguments),
|
var other = Array.prototype.slice.call(arguments),
|
||||||
instance = {};
|
instance = {};
|
||||||
|
|
||||||
Constructor.apply(instance, dependencies.concat(other));
|
// Mimic "new" behavior with apply.
|
||||||
|
instance = Constructor.apply(
|
||||||
|
instance,
|
||||||
|
dependencies.concat(other)
|
||||||
|
) || instance;
|
||||||
instance.prototype = Constructor.prototype;
|
instance.prototype = Constructor.prototype;
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
|
|||||||
Reference in New Issue
Block a user