src/third_party/mozjs/extract/js/src/builtin/RegExp.js
// Optimized path for @@match with global flag.
Optimized path for @@match with global flag.
Optimized path for @@match with global flag .
function RegExpGlobalMatchOpt(rx, S, fullUnicode) {
    var lastIndex = 0;
    rx.lastIndex = 0;
    var A = [];
    var n = 0;
    var lengthS = S.length;
    while (true) {
        i.
        var result = RegExpMatcher(rx, S, lastIndex);
        ii.
        if (result === null)
            return (n === 0) ? null : A;
        lastIndex = result.index + result[0].length;
        iii.1.
        var matchStr = result[0];
        iii.2.
        DefineDataProperty(A, n, matchStr);
        iii.4.
        if (matchStr === "") {
            lastIndex = fullUnicode ? AdvanceStringIndex(S, lastIndex) : lastIndex + 1;
            if (lastIndex > lengthS)
                return A;
        }
        iii.5.
        n++;
    }
}
function RegExpGlobalMatchOpt ( rx , S , fullUnicode ) { var lastIndex = 0 ; rx . lastIndex = 0 ; var A = [ ] ; var n = 0 ; var lengthS = S . length ; while ( true ) { var result = RegExpMatcher ( rx , S , lastIndex ) ; if ( result === null ) return ( n === 0 ) ? null : A ; lastIndex = result . index + result [ 0 ] . length ; var matchStr = result [ 0 ] ; DefineDataProperty ( A , n , matchStr ) ; if ( matchStr === "" ) { lastIndex = fullUnicode ? AdvanceStringIndex ( S , lastIndex ) : lastIndex + 1 ; if ( lastIndex > lengthS ) return A ; } n ++ ; } }
Optimized path for @@match with global flag.
Optimized path for @@match with global flag .
// Step 6.b. // Step 6.c. // Step 6.d. // Step 6.e. // Step 6.e.i. // Step 6.e.ii. // Step 6.e.iii.1. // Step 6.e.iii.2. // Step 6.e.iii.4. // Step 6.e.iii.5.