|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
672 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 | var uncurryThis = require('../internals/function-uncurry-this');
|
|---|
| 4 | var isArray = require('../internals/is-array');
|
|---|
| 5 |
|
|---|
| 6 | var nativeReverse = uncurryThis([].reverse);
|
|---|
| 7 | var test = [1, 2];
|
|---|
| 8 |
|
|---|
| 9 | // `Array.prototype.reverse` method
|
|---|
| 10 | // https://tc39.es/ecma262/#sec-array.prototype.reverse
|
|---|
| 11 | // fix for Safari 12.0 bug
|
|---|
| 12 | // https://bugs.webkit.org/show_bug.cgi?id=188794
|
|---|
| 13 | $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|---|
| 14 | reverse: function reverse() {
|
|---|
| 15 | // eslint-disable-next-line no-self-assign -- dirty hack
|
|---|
| 16 | if (isArray(this)) this.length = this.length;
|
|---|
| 17 | return nativeReverse(this);
|
|---|
| 18 | }
|
|---|
| 19 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.