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

Function isNativeReflectConstruct

docs/tests/v2/es6/js/sanddance.js:4376–4387  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4374function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4375
4376function isNativeReflectConstruct() {
4377 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
4378 if (Reflect.construct.sham) return false;
4379 if (typeof Proxy === "function") return true;
4380
4381 try {
4382 Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
4383 return true;
4384 } catch (e) {
4385 return false;
4386 }
4387}
4388
4389function _construct(Parent, args, Class) {
4390 if (isNativeReflectConstruct()) {

Callers 1

_constructFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected