You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
667 B
14 lines
667 B
'use strict';
|
|
var $ = require('../internals/export');
|
|
var notARegExp = require('../internals/not-a-regexp');
|
|
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');
|
|
|
|
// `String.prototype.includes` method
|
|
// https://tc39.github.io/ecma262/#sec-string.prototype.includes
|
|
$({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
|
includes: function includes(searchString /* , position = 0 */) {
|
|
return !!~String(requireObjectCoercible(this))
|
|
.indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
|
|
}
|
|
});
|
|
|