mirror of
https://github.com/nasa/openmct.git
synced 2025-04-07 19:34:25 +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),
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user