mirror of
https://github.com/nasa/openmct.git
synced 2025-05-29 05:34:18 +00:00
[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:
parent
2f0ea19750
commit
b1654f7034
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user