File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1408,9 +1408,6 @@ fixed.exec = function(str) {
14081408 }
14091409
14101410 // Attach named capture properties
1411- if ( XRegExp . isInstalled ( 'namespacing' ) ) {
1412- match . groups = undefined ;
1413- }
14141411 if ( this [ REGEX_DATA ] && this [ REGEX_DATA ] . captureNames ) {
14151412 let groupsObject = match ;
14161413 if ( XRegExp . isInstalled ( 'namespacing' ) ) {
@@ -1425,6 +1422,9 @@ fixed.exec = function(str) {
14251422 groupsObject [ name ] = match [ i ] ;
14261423 }
14271424 }
1425+ // Preserve any existing `groups` obj that came from native ES2018 named capture
1426+ } else if ( ! match . groups && XRegExp . isInstalled ( 'namespacing' ) ) {
1427+ match . groups = undefined ;
14281428 }
14291429
14301430 // Fix browsers that increment `lastIndex` after zero-length matches
You can’t perform that action at this time.
0 commit comments