main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
905 bytes
|
Rev | Line | |
---|
[79a0317] | 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 | // `Function.prototype[@@hasInstance]` method
|
---|
| 13 | // https://tc39.es/ecma262/#sec-function.prototype-@@hasinstance
|
---|
| 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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.