nl_tokens: ecma262 / #sec - string . prototype . substr
pl_tokens: function StringSubstr ( start , length ) { CHECK_OBJECT_COERCIBLE ( this , "String.prototype.substr" ) ; var s = TO_STRING ( this ) ; var size = s . length ; start = TO_INTEGER ( start ) ; length = IS_UNDEFINED ( length ) ? size : TO_INTEGER ( length ) ; if ( start < 0 ) start = MaxSimple ( size + start , 0 ) ; length = MinSimple ( MaxSimple ( length , 0 ) , size - start ) ; if ( length <= 0 ) return '' ; return % _SubString ( s , start , start + <mask> ) ; }