get.js 808 B

123456789101112131415161718192021222324252627282930
  1. var _Object$getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor");
  2. var _Reflect$get = require("../core-js/reflect/get");
  3. var getPrototypeOf = require("./getPrototypeOf");
  4. var superPropBase = require("./superPropBase");
  5. function _get(target, property, receiver) {
  6. if (typeof Reflect !== "undefined" && _Reflect$get) {
  7. module.exports = _get = _Reflect$get;
  8. } else {
  9. module.exports = _get = function _get(target, property, receiver) {
  10. var base = superPropBase(target, property);
  11. if (!base) return;
  12. var desc = _Object$getOwnPropertyDescriptor(base, property);
  13. if (desc.get) {
  14. return desc.get.call(receiver);
  15. }
  16. return desc.value;
  17. };
  18. }
  19. return _get(target, property, receiver || target);
  20. }
  21. module.exports = _get;