55248b0c78c1fe101e4d2face96e88e0f2ecb3b4fbc2d1507458c7da1c6ccaaa97337f6699562d618dc78a5654165f95dabaa8be291070e62630e50c285545 664 B

12345678910111213
  1. 'use strict';
  2. var isObject = require('./_is-object');
  3. var getPrototypeOf = require('./_object-gpo');
  4. var HAS_INSTANCE = require('./_wks')('hasInstance');
  5. var FunctionProto = Function.prototype;
  6. // 19.2.3.6 Function.prototype[@@hasInstance](V)
  7. if (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) {
  8. if (typeof this != 'function' || !isObject(O)) return false;
  9. if (!isObject(this.prototype)) return O instanceof this;
  10. // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
  11. while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
  12. return false;
  13. } });