massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.array.index-of.js
1 'use strict';
2 /* eslint-disable es/no-array-prototype-indexof -- required for testing */
3 var $ = require('../internals/export');
4 var uncurryThis = require('../internals/function-uncurry-this');
5 var $IndexOf = require('../internals/array-includes').indexOf;
6 var arrayMethodIsStrict = require('../internals/array-method-is-strict');
7
8 var un$IndexOf = uncurryThis([].indexOf);
9
10 var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
11 var STRICT_METHOD = arrayMethodIsStrict('indexOf');
12
13 // `Array.prototype.indexOf` method
14 // https://tc39.es/ecma262/#sec-array.prototype.indexof
15 $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
16   indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
17     var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
18     return NEGATIVE_ZERO
19       // convert -0 to +0
20       ? un$IndexOf(this, searchElement, fromIndex) || 0
21       : $IndexOf(this, searchElement, fromIndex);
22   }
23 });