@@ -338,19 +338,19 @@ function typicalBadHtmlSanitizers(s) {
338338}
339339
340340function bad18NewRegExp ( p ) {
341- return p . replace ( new RegExp ( "\\.\\./" ) , "" ) ; // NOT OK -- should be flagged, but currently checking only for literals
341+ return p . replace ( new RegExp ( "\\.\\./" ) , "" ) ; // NOT OK
342342}
343343
344344function bad4NewRegExpG ( s ) {
345- return s . replace ( new RegExp ( "\'" , "g" ) , "\\$&" ) ; // NOT OK -- should be flagged, but currently checking only for literals
345+ return s . replace ( new RegExp ( "\'" , "g" ) , "\\$&" ) ; // NOT OK
346346}
347347
348348function bad4NewRegExp ( s ) {
349- return s . replace ( new RegExp ( "\'" ) , "\\$&" ) ; // NOT OK -- should be flagged, but currently checking only for literals
349+ return s . replace ( new RegExp ( "\'" ) , "\\$&" ) ; // NOT OK
350350}
351351
352352function bad4NewRegExpUnknown ( s ) {
353- return s . replace ( new RegExp ( "\'" , unknownFlags ( ) ) , "\\$&" ) ; // NOT OK -- should be flagged, but currently checking only for literals
353+ return s . replace ( new RegExp ( "\'" , unknownFlags ( ) ) , "\\$&" ) ; // NOT OK
354354}
355355
356356function newlinesNewReGexp ( s ) {
@@ -359,9 +359,9 @@ function newlinesNewReGexp(s) {
359359 x . replace ( new RegExp ( "\n" , "g" ) , "" ) . replace ( x , y ) ; // OK
360360 x . replace ( x , y ) . replace ( new RegExp ( "\n" , "g" ) , "" ) ; // OK
361361
362- x . replace ( new RegExp ( "\n" ) , "" ) . replace ( x , y ) ; // NOT OK -- should be flagged, but currently checking only for literals
363- x . replace ( x , y ) . replace ( new RegExp ( "\n" ) , "" ) ; // NOT OK -- should be flagged, but currently checking only for literals
362+ x . replace ( new RegExp ( "\n" ) , "" ) . replace ( x , y ) ; // NOT OK
363+ x . replace ( x , y ) . replace ( new RegExp ( "\n" ) , "" ) ; // NOT OK
364364
365- x . replace ( new RegExp ( "\n" , unknownFlags ( ) ) , "" ) . replace ( x , y ) ; // OK
366- x . replace ( x , y ) . replace ( new RegExp ( "\n" , unknownFlags ( ) ) , "" ) ; // OK
365+ x . replace ( new RegExp ( "\n" , unknownFlags ( ) ) , "" ) . replace ( x , y ) ; // OK -- Should not be flagged but now it is
366+ x . replace ( x , y ) . replace ( new RegExp ( "\n" , unknownFlags ( ) ) , "" ) ; // OK -- Should not be flagged but now it is
367367}
0 commit comments