File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -642,15 +642,15 @@ function isSetup() {
642
642
function joinRegExp ( patterns ) {
643
643
// Combine an array of regular expressions and strings into one large regexp
644
644
// Be mad.
645
- var sources = [ ] , i = patterns . length ;
646
- while ( i -- ) {
645
+ var sources = [ ] ;
646
+ for ( var i = 0 ; i < patterns . length ; i ++ ) {
647
647
if ( isString ( patterns [ i ] ) ) {
648
648
// If it's a string, we need to escape it
649
649
// Taken from: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
650
- sources . unshift ( patterns [ i ] . replace ( / ( [ . * + ? ^ = ! : $ { } ( ) | \[ \] \/ \\ ] ) / g, "\\$1" ) ) ;
651
- } else if ( ! isUndefined ( patterns [ i ] ) && patterns [ i ] && patterns [ i ] . source ) {
650
+ sources . push ( patterns [ i ] . replace ( / ( [ . * + ? ^ = ! : $ { } ( ) | \[ \] \/ \\ ] ) / g, "\\$1" ) ) ;
651
+ } else if ( patterns [ i ] && patterns [ i ] . source ) {
652
652
// If it's a regexp already, we want to extract the source
653
- sources . unshift ( patterns [ i ] . source ) ;
653
+ sources . push ( patterns [ i ] . source ) ;
654
654
}
655
655
// Intentionally skip other cases
656
656
}
You can’t perform that action at this time.
0 commit comments