Sha256: 45003b70969fa3251d1e283123dba2ce8dfa78217dbaf2ea0600f4be3dc6fe1c
Contents?: true
Size: 938 Bytes
Versions: 19
Compression:
Stored size: 938 Bytes
Contents
var setPrototypeOf = require("./setPrototypeOf"); function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { module.exports = _construct = Reflect.construct; } else { module.exports = _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); } module.exports = _construct;
Version data entries
19 entries across 19 versions & 5 rubygems