mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-24 21:11:23 +01:00
merge completed... now to fix all the bugs...
This commit is contained in:
commit
87c4d80fbc
3472 changed files with 466748 additions and 6517 deletions
30
node_modules/es-abstract/2020/InstanceofOperator.js
generated
vendored
Normal file
30
node_modules/es-abstract/2020/InstanceofOperator.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var $hasInstance = GetIntrinsic('Symbol.hasInstance', true);
|
||||
|
||||
var Call = require('./Call');
|
||||
var GetMethod = require('./GetMethod');
|
||||
var IsCallable = require('./IsCallable');
|
||||
var OrdinaryHasInstance = require('./OrdinaryHasInstance');
|
||||
var ToBoolean = require('./ToBoolean');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://ecma-international.org/ecma-262/6.0/#sec-instanceofoperator
|
||||
|
||||
module.exports = function InstanceofOperator(O, C) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
var instOfHandler = $hasInstance ? GetMethod(C, $hasInstance) : void 0;
|
||||
if (typeof instOfHandler !== 'undefined') {
|
||||
return ToBoolean(Call(instOfHandler, C, [O]));
|
||||
}
|
||||
if (!IsCallable(C)) {
|
||||
throw new $TypeError('`C` is not Callable');
|
||||
}
|
||||
return OrdinaryHasInstance(C, O);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue