main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
794 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var $ = require('../internals/export');
|
---|
3 | var $includes = require('../internals/array-includes').includes;
|
---|
4 | var fails = require('../internals/fails');
|
---|
5 | var addToUnscopables = require('../internals/add-to-unscopables');
|
---|
6 |
|
---|
7 | // FF99+ bug
|
---|
8 | var BROKEN_ON_SPARSE = fails(function () {
|
---|
9 | // eslint-disable-next-line es/no-array-prototype-includes -- detection
|
---|
10 | return !Array(1).includes();
|
---|
11 | });
|
---|
12 |
|
---|
13 | // `Array.prototype.includes` method
|
---|
14 | // https://tc39.es/ecma262/#sec-array.prototype.includes
|
---|
15 | $({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
|
---|
16 | includes: function includes(el /* , fromIndex = 0 */) {
|
---|
17 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
---|
18 | }
|
---|
19 | });
|
---|
20 |
|
---|
21 | // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
|
---|
22 | addToUnscopables('includes');
|
---|
Note:
See
TracBrowser
for help on using the repository browser.