Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.array.reduce-right.js
1 'use strict';
2 var $ = require('../internals/export');
3 var $reduceRight = require('../internals/array-reduce').right;
4 var arrayMethodIsStrict = require('../internals/array-method-is-strict');
5 var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
6 var CHROME_VERSION = require('../internals/engine-v8-version');
7 var IS_NODE = require('../internals/engine-is-node');
8
9 var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
10 // For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
11 var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
12 // Chrome 80-82 has a critical bug
13 // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
14 var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
15
16 // `Array.prototype.reduceRight` method
17 // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
18 $({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
19   reduceRight: function reduceRight(callbackfn /* , initialValue */) {
20     return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
21   }
22 });