diff options
Diffstat (limited to 'node_modules/babel-runtime/helpers/get.js')
-rw-r--r-- | node_modules/babel-runtime/helpers/get.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/node_modules/babel-runtime/helpers/get.js b/node_modules/babel-runtime/helpers/get.js new file mode 100644 index 000000000..38b79b760 --- /dev/null +++ b/node_modules/babel-runtime/helpers/get.js @@ -0,0 +1,38 @@ +"use strict"; + +exports.__esModule = true; + +var _getPrototypeOf = require("../core-js/object/get-prototype-of"); + +var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); + +var _getOwnPropertyDescriptor = require("../core-js/object/get-own-property-descriptor"); + +var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = (0, _getOwnPropertyDescriptor2.default)(object, property); + + if (desc === undefined) { + var parent = (0, _getPrototypeOf2.default)(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +};
\ No newline at end of file |