text: 'use strict';
  var $    = require('./$')
    , cof  = require('./$.cof')
    , $def = require('./$.def')
    , toLength = $.toLength;
  
  $def($def.P, 'String', {
    // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
    endsWith: function(searchString /*, endPosition = @length */){
      if(cof(searchString) == 'RegExp')throw TypeError();
      var that = String($.assertDefined(this))
        , endPosition = arguments[1]
        , len = toLength(that.length)
        , end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
      searchString += '';
      return that.slice(end - searchString.length, end) === searchString;
    }
  });