package.modules.es.object.define-setter.js Maven / Gradle / Ivy
The newest version!
'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/object-prototype-accessors-forced');
var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var definePropertyModule = require('../internals/object-define-property');
// `Object.prototype.__defineSetter__` method
// https://tc39.es/ecma262/#sec-object.prototype.__defineSetter__
if (DESCRIPTORS) {
$({ target: 'Object', proto: true, forced: FORCED }, {
__defineSetter__: function __defineSetter__(P, setter) {
definePropertyModule.f(toObject(this), P, { set: aCallable(setter), enumerable: true, configurable: true });
}
});
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy