main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[79a0317] | 1 | 'use strict';
|
---|
| 2 | var DESCRIPTORS = require('../internals/descriptors');
|
---|
| 3 | var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
|
---|
| 4 | var isObject = require('../internals/is-object');
|
---|
| 5 | var isPossiblePrototype = require('../internals/is-possible-prototype');
|
---|
| 6 | var toObject = require('../internals/to-object');
|
---|
| 7 | var requireObjectCoercible = require('../internals/require-object-coercible');
|
---|
| 8 |
|
---|
| 9 | // eslint-disable-next-line es/no-object-getprototypeof -- safe
|
---|
| 10 | var getPrototypeOf = Object.getPrototypeOf;
|
---|
| 11 | // eslint-disable-next-line es/no-object-setprototypeof -- safe
|
---|
| 12 | var setPrototypeOf = Object.setPrototypeOf;
|
---|
| 13 | var ObjectPrototype = Object.prototype;
|
---|
| 14 | var PROTO = '__proto__';
|
---|
| 15 |
|
---|
| 16 | // `Object.prototype.__proto__` accessor
|
---|
| 17 | // https://tc39.es/ecma262/#sec-object.prototype.__proto__
|
---|
| 18 | if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototype)) try {
|
---|
| 19 | defineBuiltInAccessor(ObjectPrototype, PROTO, {
|
---|
| 20 | configurable: true,
|
---|
| 21 | get: function __proto__() {
|
---|
| 22 | return getPrototypeOf(toObject(this));
|
---|
| 23 | },
|
---|
| 24 | set: function __proto__(proto) {
|
---|
| 25 | var O = requireObjectCoercible(this);
|
---|
| 26 | if (isPossiblePrototype(proto) && isObject(O)) {
|
---|
| 27 | setPrototypeOf(O, proto);
|
---|
| 28 | }
|
---|
| 29 | }
|
---|
| 30 | });
|
---|
| 31 | } catch (error) { /* empty */ }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.