es7.object.define-getter.js 505 B

123456789101112
  1. 'use strict';
  2. var $export = require('./_export');
  3. var toObject = require('./_to-object');
  4. var aFunction = require('./_a-function');
  5. var $defineProperty = require('./_object-dp');
  6. // B.2.2.2 Object.prototype.__defineGetter__(P, getter)
  7. require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {
  8. __defineGetter__: function __defineGetter__(P, getter) {
  9. $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
  10. }
  11. });