MCPcopy Create free account
hub / github.com/microsoft/SandDance / _construct

Function _construct

docs/tests/v2/es6/js/sanddance.js:4389–4404  ·  view source on GitHub ↗
(Parent, args, Class)

Source from the content-addressed store, hash-verified

4387}
4388
4389function _construct(Parent, args, Class) {
4390 if (isNativeReflectConstruct()) {
4391 exports.default = _construct = Reflect.construct;
4392 } else {
4393 exports.default = _construct = function _construct(Parent, args, Class) {
4394 var a = [null];
4395 a.push.apply(a, args);
4396 var Constructor = Function.bind.apply(Parent, a);
4397 var instance = new Constructor();
4398 if (Class) (0, _setPrototypeOf.default)(instance, Class.prototype);
4399 return instance;
4400 };
4401 }
4402
4403 return _construct.apply(null, arguments);
4404}
4405},{"./setPrototypeOf":"hewo"}],"E5yL":[function(require,module,exports) {
4406"use strict";
4407

Callers

nothing calls this directly

Calls 1

isNativeReflectConstructFunction · 0.85

Tested by

no test coverage detected