mirror of
https://github.com/musix-org/musix-oss
synced 2024-12-23 22:33:17 +00:00
25 lines
1008 B
JavaScript
25 lines
1008 B
JavaScript
|
var $ = require('../internals/export');
|
||
|
var isObject = require('../internals/is-object');
|
||
|
var anObject = require('../internals/an-object');
|
||
|
var has = require('../internals/has');
|
||
|
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
|
||
|
var getPrototypeOf = require('../internals/object-get-prototype-of');
|
||
|
|
||
|
// `Reflect.get` method
|
||
|
// https://tc39.github.io/ecma262/#sec-reflect.get
|
||
|
function get(target, propertyKey /* , receiver */) {
|
||
|
var receiver = arguments.length < 3 ? target : arguments[2];
|
||
|
var descriptor, prototype;
|
||
|
if (anObject(target) === receiver) return target[propertyKey];
|
||
|
if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value')
|
||
|
? descriptor.value
|
||
|
: descriptor.get === undefined
|
||
|
? undefined
|
||
|
: descriptor.get.call(receiver);
|
||
|
if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);
|
||
|
}
|
||
|
|
||
|
$({ target: 'Reflect', stat: true }, {
|
||
|
get: get
|
||
|
});
|