File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1294,11 +1294,8 @@ describe('XRegExp.replace()', function() {
12941294 } ) ;
12951295
12961296 it ( 'should throw an exception for backreferences to unknown group numbers when using named capture' , function ( ) {
1297- expect ( function ( ) { XRegExp . replace ( 'test' , XRegExp ( '(?<n>t)' ) , '$2' ) ; } ) . toThrowError ( SyntaxError ) ;
12981297 expect ( function ( ) { XRegExp . replace ( 'test' , XRegExp ( '(?<n>t)' ) , '$<2>' ) ; } ) . toThrowError ( SyntaxError ) ;
1299-
13001298 // Native named capture introduced in ES2018
1301- expect ( function ( ) { XRegExp . replace ( 'test' , / (?< n > t ) / , '$2' ) ; } ) . toThrowError ( SyntaxError ) ;
13021299 expect ( function ( ) { XRegExp . replace ( 'test' , / (?< n > t ) / , '$<2>' ) ; } ) . toThrowError ( SyntaxError ) ;
13031300 } ) ;
13041301
@@ -1351,6 +1348,12 @@ describe('XRegExp.replace()', function() {
13511348 expect ( function ( ) { XRegExp . replace ( 'xa(a)a' , 'a(a)' , '$1b' ) ; } ) . toThrowError ( SyntaxError ) ;
13521349 } ) ;
13531350
1351+ it ( 'should throw an exception for backreferences to unknown group numbers when using named capture' , function ( ) {
1352+ expect ( function ( ) { XRegExp . replace ( 'test' , XRegExp ( '(?<n>t)' ) , '$2' ) ; } ) . toThrowError ( SyntaxError ) ;
1353+ // Native named capture introduced in ES2018
1354+ expect ( function ( ) { XRegExp . replace ( 'test' , / (?< n > t ) / , '$2' ) ; } ) . toThrowError ( SyntaxError ) ;
1355+ } ) ;
1356+
13541357 } ) ;
13551358
13561359 } ) ;
You can’t perform that action at this time.
0 commit comments