Sha256: fcc728fd1b296a34d792eff35d9b641975d6bd641dcdf15066a3ff79dce7eb2f
Contents?: true
Size: 613 Bytes
Versions: 243
Compression:
Stored size: 613 Bytes
Contents
'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; };
Version data entries
243 entries across 27 versions & 2 rubygems