2016-10-10 03:43:44 +02:00
|
|
|
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
|
2017-05-27 17:36:13 +02:00
|
|
|
var gOPD = require('./_object-gopd')
|
|
|
|
, getPrototypeOf = require('./_object-gpo')
|
|
|
|
, has = require('./_has')
|
|
|
|
, $export = require('./_export')
|
|
|
|
, isObject = require('./_is-object')
|
|
|
|
, anObject = require('./_an-object');
|
2016-10-10 03:43:44 +02:00
|
|
|
|
|
|
|
function get(target, propertyKey/*, receiver*/){
|
|
|
|
var receiver = arguments.length < 3 ? target : arguments[2]
|
|
|
|
, desc, proto;
|
|
|
|
if(anObject(target) === receiver)return target[propertyKey];
|
2017-05-27 17:36:13 +02:00
|
|
|
if(desc = gOPD.f(target, propertyKey))return has(desc, 'value')
|
2016-10-10 03:43:44 +02:00
|
|
|
? desc.value
|
|
|
|
: desc.get !== undefined
|
|
|
|
? desc.get.call(receiver)
|
|
|
|
: undefined;
|
2017-05-27 17:36:13 +02:00
|
|
|
if(isObject(proto = getPrototypeOf(target)))return get(proto, propertyKey, receiver);
|
2016-10-10 03:43:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$export($export.S, 'Reflect', {get: get});
|