MCPcopy Index your code
hub / github.com/socketio/socket.io / _construct

Function _construct

client-dist/socket.io.js:97–111  ·  view source on GitHub ↗
(Parent, args, Class)

Source from the content-addressed store, hash-verified

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 }

Callers 1

WrapperFunction · 0.85

Calls 3

_setPrototypeOfFunction · 0.85
bindMethod · 0.80

Tested by

no test coverage detected