|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
857 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 | var $ = require('../internals/export');
|
|---|
| 3 | var uncurryThis = require('../internals/function-uncurry-this');
|
|---|
| 4 | var notARegExp = require('../internals/not-a-regexp');
|
|---|
| 5 | var requireObjectCoercible = require('../internals/require-object-coercible');
|
|---|
| 6 | var toString = require('../internals/to-string');
|
|---|
| 7 | var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
|
|---|
| 8 |
|
|---|
| 9 | var stringIndexOf = uncurryThis(''.indexOf);
|
|---|
| 10 |
|
|---|
| 11 | // `String.prototype.includes` method
|
|---|
| 12 | // https://tc39.es/ecma262/#sec-string.prototype.includes
|
|---|
| 13 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|---|
| 14 | includes: function includes(searchString /* , position = 0 */) {
|
|---|
| 15 | return !!~stringIndexOf(
|
|---|
| 16 | toString(requireObjectCoercible(this)),
|
|---|
| 17 | toString(notARegExp(searchString)),
|
|---|
| 18 | arguments.length > 1 ? arguments[1] : undefined
|
|---|
| 19 | );
|
|---|
| 20 | }
|
|---|
| 21 | });
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.