Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
911 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 | var $ = require('../internals/export');
|
---|
| 3 | var DESCRIPTORS = require('../internals/descriptors');
|
---|
| 4 | var FORCED = require('../internals/object-prototype-accessors-forced');
|
---|
| 5 | var toObject = require('../internals/to-object');
|
---|
| 6 | var toPropertyKey = require('../internals/to-property-key');
|
---|
| 7 | var getPrototypeOf = require('../internals/object-get-prototype-of');
|
---|
| 8 | var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
|
---|
| 9 |
|
---|
| 10 | // `Object.prototype.__lookupSetter__` method
|
---|
| 11 | // https://tc39.es/ecma262/#sec-object.prototype.__lookupSetter__
|
---|
| 12 | if (DESCRIPTORS) {
|
---|
| 13 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
---|
| 14 | __lookupSetter__: function __lookupSetter__(P) {
|
---|
| 15 | var O = toObject(this);
|
---|
| 16 | var key = toPropertyKey(P);
|
---|
| 17 | var desc;
|
---|
| 18 | do {
|
---|
| 19 | if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;
|
---|
| 20 | } while (O = getPrototypeOf(O));
|
---|
| 21 | }
|
---|
| 22 | });
|
---|
| 23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.