PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/node_modules/babel-polyfill/node_modules/core-js/library/modules/es6.function.has-instance.js

https://bitbucket.org/worklabschd/bingle_customer2
JavaScript | 13 lines | 11 code | 0 blank | 2 comment | 7 complexity | 2860024eaea6b403a692497ef4c803b3 MD5 | raw file
 1'use strict';
 2var isObject = require('./_is-object');
 3var getPrototypeOf = require('./_object-gpo');
 4var HAS_INSTANCE = require('./_wks')('hasInstance');
 5var FunctionProto = Function.prototype;
 6// 19.2.3.6 Function.prototype[@@hasInstance](V)
 7if (!(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} });