source: frontend/node_modules/es-abstract/2016/OrdinaryHasInstance.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

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