1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 19:23:18 +00:00
musix-oss/node_modules/core-js/modules/es.array.reverse.js

18 lines
545 B
JavaScript
Raw Normal View History

2019-10-10 13:43:04 +00:00
'use strict';
var $ = require('../internals/export');
var isArray = require('../internals/is-array');
var nativeReverse = [].reverse;
var test = [1, 2];
// `Array.prototype.reverse` method
// https://tc39.github.io/ecma262/#sec-array.prototype.reverse
// fix for Safari 12.0 bug
// https://bugs.webkit.org/show_bug.cgi?id=188794
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
reverse: function reverse() {
if (isArray(this)) this.length = this.length;
return nativeReverse.call(this);
}
});