frontend/.pnpm-store/v3/files/1e/e9c515301938d11cb1ee937100f4901d5b862cd6e36d0d99a7a7980847c19bfc002952ea64416c76e893c2e52e8ff6f107cd751aad7b3a33347dc08002e239

26 lines
613 B
Plaintext

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var Get = require('./Get');
var IsCallable = require('./IsCallable');
var Type = require('./Type');
// https://262.ecma-international.org/6.0/#sec-ordinaryhasinstance
module.exports = function OrdinaryHasInstance(C, O) {
if (!IsCallable(C)) {
return false;
}
if (Type(O) !== 'Object') {
return false;
}
var P = Get(C, 'prototype');
if (Type(P) !== 'Object') {
throw new $TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
}
return O instanceof C;
};