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