wallet-core/node_modules/core-js/modules/es6.reflect.get.js

20 lines
727 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
// 26.1.6 Reflect.get(target, propertyKey [, receiver])
var $ = require('./$')
, 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];
if(desc = $.getDesc(target, propertyKey))return has(desc, 'value')
2016-10-10 03:43:44 +02:00
? desc.value
: desc.get !== undefined
? desc.get.call(receiver)
: undefined;
if(isObject(proto = $.getProto(target)))return get(proto, propertyKey, receiver);
2016-10-10 03:43:44 +02:00
}
$export($export.S, 'Reflect', {get: get});