summaryrefslogtreecommitdiff
path: root/node_modules/core-js/modules/es6.string.includes.js
blob: e2ab8db7ebaa408fc9a9d543aa00cfe8919f5c01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 21.1.3.7 String.prototype.includes(searchString, position = 0)
'use strict';
var $export  = require('./$.export')
  , context  = require('./$.string-context')
  , INCLUDES = 'includes';

$export($export.P + $export.F * require('./$.fails-is-regexp')(INCLUDES), 'String', {
  includes: function includes(searchString /*, position = 0 */){
    return !!~context(this, searchString, INCLUDES)
      .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  }
});