This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/core-js/modules/es.object.lookup-setter.js
2020-11-01 22:46:04 +00:00

24 lines
917 B
JavaScript

'use strict';
var $ = require('../internals/export');
var DESCRIPTORS = require('../internals/descriptors');
var FORCED = require('../internals/object-prototype-accessors-forced');
var toObject = require('../internals/to-object');
var toPrimitive = require('../internals/to-primitive');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
// `Object.prototype.__lookupSetter__` method
// https://tc39.github.io/ecma262/#sec-object.prototype.__lookupSetter__
if (DESCRIPTORS) {
$({ target: 'Object', proto: true, forced: FORCED }, {
__lookupSetter__: function __lookupSetter__(P) {
var O = toObject(this);
var key = toPrimitive(P, true);
var desc;
do {
if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;
} while (O = getPrototypeOf(O));
}
});
}