es7.object.define-setter.js 505 B

12345678910111213
  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.3 Object.prototype.__defineSetter__(P, setter)
  7. require('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {
  8. __defineSetter__: function __defineSetter__(P, setter) {
  9. $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
  10. }
  11. });