Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
722 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 | var $ = require('../internals/export');
|
---|
| 3 | var notARegExp = require('../internals/not-a-regexp');
|
---|
| 4 | var requireObjectCoercible = require('../internals/require-object-coercible');
|
---|
| 5 | var toString = require('../internals/to-string');
|
---|
| 6 | var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
|
---|
| 7 |
|
---|
| 8 | // `String.prototype.includes` method
|
---|
| 9 | // https://tc39.es/ecma262/#sec-string.prototype.includes
|
---|
| 10 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
---|
| 11 | includes: function includes(searchString /* , position = 0 */) {
|
---|
| 12 | return !!~toString(requireObjectCoercible(this))
|
---|
| 13 | .indexOf(toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined);
|
---|
| 14 | }
|
---|
| 15 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.