Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
utf8mb4
Commit Description:
utf8mb4
"use strict" ;
var numberIsNaN = require ( "../../number/is-nan" )
, toPosInt = require ( "../../number/to-pos-integer" )
, value = require ( "../../object/valid-value" )
, indexOf = Array . prototype . indexOf
, objHasOwnProperty = Object . prototype . hasOwnProperty
, abs = Math . abs
, floor = Math . floor ;
module . exports = function ( searchElement /*, fromIndex*/ ) {
var i , length , fromIndex , val ;
if ( ! numberIsNaN ( searchElement )) return indexOf . apply ( this , arguments );
length = toPosInt ( value ( this ). length );
fromIndex = arguments [ 1 ];
if ( isNaN ( fromIndex )) fromIndex = 0 ;
else if ( fromIndex >= 0 ) fromIndex = floor ( fromIndex );
else fromIndex = toPosInt ( this . length ) - floor ( abs ( fromIndex ));
for ( i = fromIndex ; i < length ; ++ i ) {
if ( objHasOwnProperty . call ( this , i )) {
val = this [ i ];
if ( numberIsNaN ( val )) return i ; // Jslint: ignore
}
}
return - 1 ;
};
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings