1 | 'use strict';
|
2 | var isCallable = require('../internals/is-callable');
|
3 | var isObject = require('../internals/is-object');
|
4 | var definePropertyModule = require('../internals/object-define-property');
|
5 | var isPrototypeOf = require('../internals/object-is-prototype-of');
|
6 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
7 | var makeBuiltIn = require('../internals/make-built-in');
|
8 |
|
9 | var HAS_INSTANCE = wellKnownSymbol('hasInstance');
|
10 | var FunctionPrototype = Function.prototype;
|
11 |
|
12 |
|
13 |
|
14 | if (!(HAS_INSTANCE in FunctionPrototype)) {
|
15 | definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function (O) {
|
16 | if (!isCallable(this) || !isObject(O)) return false;
|
17 | var P = this.prototype;
|
18 | return isObject(P) ? isPrototypeOf(P, O) : O instanceof this;
|
19 | }, HAS_INSTANCE) });
|
20 | }
|