Urara-Blog/node_modules/.pnpm-store/v3/files/2b/6e484e92fd465510034880277ea4291fc74688d11853183fbd120a66a4f317bc83207d5a94bb185574165fe9f8c9d572bdbc0e84905a3ce288356ad06f6ed3
2022-08-14 01:14:53 +08:00

20 lines
531 B
Text

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');
// https://ecma-international.org/ecma-262/6.0/#sec-ordinaryhasproperty
module.exports = function OrdinaryHasProperty(O, P) {
if (Type(O) !== 'Object') {
throw new $TypeError('Assertion failed: Type(O) is not Object');
}
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: P must be a Property Key');
}
return P in O;
};