isNativeReflectConstruct.js 369 B

123456789101112
  1. export default function _isNativeReflectConstruct() {
  2. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  3. if (Reflect.construct.sham) return false;
  4. if (typeof Proxy === "function") return true;
  5. try {
  6. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
  7. return true;
  8. } catch (e) {
  9. return false;
  10. }
  11. }