(Parent, args, Class)
| 95 | } |
| 96 | } |
| 97 | function _construct(Parent, args, Class) { |
| 98 | if (_isNativeReflectConstruct()) { |
| 99 | _construct = Reflect.construct.bind(); |
| 100 | } else { |
| 101 | _construct = function _construct(Parent, args, Class) { |
| 102 | var a = [null]; |
| 103 | a.push.apply(a, args); |
| 104 | var Constructor = Function.bind.apply(Parent, a); |
| 105 | var instance = new Constructor(); |
| 106 | if (Class) _setPrototypeOf(instance, Class.prototype); |
| 107 | return instance; |
| 108 | }; |
| 109 | } |
| 110 | return _construct.apply(null, arguments); |
| 111 | } |
| 112 | function _isNativeFunction(fn) { |
| 113 | return Function.toString.call(fn).indexOf("[native code]") !== -1; |
| 114 | } |
no test coverage detected