source: trip-planner-front/node_modules/core-js/modules/es.array.reverse.js

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: 599 bytes
RevLine 
[6a3a178]1'use strict';
2var $ = require('../internals/export');
3var isArray = require('../internals/is-array');
4
5var nativeReverse = [].reverse;
6var 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.