source: imaps-frontend/node_modules/es-abstract/2021/OrdinaryHasInstance.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 567 bytes
RevLine 
[d565449]1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var Get = require('./Get');
6var IsCallable = require('./IsCallable');
[79a0317]7
8var isObject = require('../helpers/isObject');
[d565449]9
10// https://262.ecma-international.org/6.0/#sec-ordinaryhasinstance
11
12module.exports = function OrdinaryHasInstance(C, O) {
13 if (!IsCallable(C)) {
14 return false;
15 }
[79a0317]16 if (!isObject(O)) {
[d565449]17 return false;
18 }
19 var P = Get(C, 'prototype');
[79a0317]20 if (!isObject(P)) {
[d565449]21 throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
22 }
23 return O instanceof C;
24};
Note: See TracBrowser for help on using the repository browser.