Urara-Blog/node_modules/.pnpm-store/v3/files/93/f196f6940b95a9e7d4214f31d20c4866170e9b608690000654af7451b01d772c29b9ca980d06fcac20ac7b3b88fd72d1f65d1a894b8bce77e0da1b27b2c23c
2022-08-14 01:14:53 +08:00

23 lines
474 B
Text

'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var IsPropertyKey = require('./IsPropertyKey');
var ToObject = require('./ToObject');
// https://ecma-international.org/ecma-262/6.0/#sec-getv
module.exports = function GetV(V, P) {
// 7.3.2.1
if (!IsPropertyKey(P)) {
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
}
// 7.3.2.2-3
var O = ToObject(V);
// 7.3.2.4
return O[P];
};