diff --git a/javascript/extractor/tests/es2024/input/test.js b/javascript/extractor/tests/es2024/input/test.js new file mode 100644 index 000000000000..1f96a35e4c21 --- /dev/null +++ b/javascript/extractor/tests/es2024/input/test.js @@ -0,0 +1 @@ +const regex = /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv; diff --git a/javascript/extractor/tests/es2024/output/trap/test.js.trap b/javascript/extractor/tests/es2024/output/trap/test.js.trap new file mode 100644 index 000000000000..3baa7137d9ce --- /dev/null +++ b/javascript/extractor/tests/es2024/output/trap/test.js.trap @@ -0,0 +1,525 @@ +#10000=@"/test.js;sourcefile" +files(#10000,"/test.js") +#10001=@"/;folder" +folders(#10001,"/") +containerparent(#10001,#10000) +#10002=@"loc,{#10000},0,0,0,0" +locations_default(#10002,#10000,0,0,0,0) +hasLocation(#10000,#10002) +#20000=@"global_scope" +scopes(#20000,0) +#20001=@"script;{#10000},1,1" +#20002=* +lines(#20002,#20001,"const regex = /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv;"," +") +#20003=@"loc,{#10000},1,1,1,172" +locations_default(#20003,#10000,1,1,1,172) +hasLocation(#20002,#20003) +numlines(#20001,1,1,0) +#20004=* +tokeninfo(#20004,7,#20001,0,"const") +#20005=@"loc,{#10000},1,1,1,5" +locations_default(#20005,#10000,1,1,1,5) +hasLocation(#20004,#20005) +#20006=* +tokeninfo(#20006,6,#20001,1,"regex") +#20007=@"loc,{#10000},1,7,1,11" +locations_default(#20007,#10000,1,7,1,11) +hasLocation(#20006,#20007) +#20008=* +tokeninfo(#20008,8,#20001,2,"=") +#20009=@"loc,{#10000},1,13,1,13" +locations_default(#20009,#10000,1,13,1,13) +hasLocation(#20008,#20009) +#20010=* +tokeninfo(#20010,5,#20001,3,"/\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv") +#20011=@"loc,{#10000},1,15,1,171" +locations_default(#20011,#10000,1,15,1,171) +hasLocation(#20010,#20011) +#20012=* +tokeninfo(#20012,8,#20001,4,";") +#20013=@"loc,{#10000},1,172,1,172" +locations_default(#20013,#10000,1,172,1,172) +hasLocation(#20012,#20013) +#20014=* +tokeninfo(#20014,0,#20001,5,"") +#20015=@"loc,{#10000},2,1,2,0" +locations_default(#20015,#10000,2,1,2,0) +hasLocation(#20014,#20015) +toplevels(#20001,0) +#20016=@"loc,{#10000},1,1,2,0" +locations_default(#20016,#10000,1,1,2,0) +hasLocation(#20001,#20016) +#20017=@"var;{regex};{#20000}" +variables(#20017,"regex",#20000) +#20018=* +stmts(#20018,22,#20001,0,"const r ... +)/gmv;") +hasLocation(#20018,#20003) +stmt_containers(#20018,#20001) +#20019=* +exprs(#20019,64,#20018,0,"regex = ... )+)/gmv") +#20020=@"loc,{#10000},1,7,1,171" +locations_default(#20020,#10000,1,7,1,171) +hasLocation(#20019,#20020) +enclosing_stmt(#20019,#20018) +expr_containers(#20019,#20001) +#20021=* +exprs(#20021,78,#20019,0,"regex") +hasLocation(#20021,#20007) +enclosing_stmt(#20021,#20018) +expr_containers(#20021,#20001) +literals("regex","regex",#20021) +decl(#20021,#20017) +#20022=* +exprs(#20022,5,#20019,1,"/\b(?:h ... )+)/gmv") +hasLocation(#20022,#20011) +enclosing_stmt(#20022,#20018) +expr_containers(#20022,#20001) +literals("/\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv","/\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv",#20022) +#20023=* +regexpterm(#20023,0,#20022,0,"\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)") +#20024=@"loc,{#10000},1,16,1,167" +locations_default(#20024,#10000,1,16,1,167) +hasLocation(#20023,#20024) +#20025=* +regexpterm(#20025,1,#20023,0,"\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+") +#20026=@"loc,{#10000},1,16,1,98" +locations_default(#20026,#10000,1,16,1,98) +hasLocation(#20025,#20026) +#20027=* +regexpterm(#20027,4,#20025,0,"\b") +#20028=@"loc,{#10000},1,16,1,17" +locations_default(#20028,#10000,1,16,1,17) +hasLocation(#20027,#20028) +#20029=* +regexpterm(#20029,13,#20025,1,"(?:https?:\/\/|mailto:|www\.)") +#20030=@"loc,{#10000},1,18,1,46" +locations_default(#20030,#10000,1,18,1,46) +hasLocation(#20029,#20030) +#20031=* +regexpterm(#20031,0,#20029,0,"https?:\/\/|mailto:|www\.") +#20032=@"loc,{#10000},1,21,1,45" +locations_default(#20032,#10000,1,21,1,45) +hasLocation(#20031,#20032) +#20033=* +regexpterm(#20033,1,#20031,0,"https?:\/\/") +#20034=@"loc,{#10000},1,21,1,31" +locations_default(#20034,#10000,1,21,1,31) +hasLocation(#20033,#20034) +#20035=* +regexpterm(#20035,14,#20033,0,"http") +#20036=@"loc,{#10000},1,21,1,24" +locations_default(#20036,#10000,1,21,1,24) +hasLocation(#20035,#20036) +regexp_const_value(#20035,"http") +#20037=* +regexpterm(#20037,10,#20033,1,"s?") +#20038=@"loc,{#10000},1,25,1,26" +locations_default(#20038,#10000,1,25,1,26) +hasLocation(#20037,#20038) +is_greedy(#20037) +#20039=* +regexpterm(#20039,14,#20037,0,"s") +#20040=@"loc,{#10000},1,25,1,25" +locations_default(#20040,#10000,1,25,1,25) +hasLocation(#20039,#20040) +regexp_const_value(#20039,"s") +#20041=* +regexpterm(#20041,14,#20033,2,":") +#20042=@"loc,{#10000},1,27,1,27" +locations_default(#20042,#10000,1,27,1,27) +hasLocation(#20041,#20042) +regexp_const_value(#20041,":") +#20043=* +regexpterm(#20043,21,#20033,3,"\/") +#20044=@"loc,{#10000},1,28,1,29" +locations_default(#20044,#10000,1,28,1,29) +hasLocation(#20043,#20044) +regexp_const_value(#20043,"/") +#20045=* +regexpterm(#20045,21,#20033,4,"\/") +#20046=@"loc,{#10000},1,30,1,31" +locations_default(#20046,#10000,1,30,1,31) +hasLocation(#20045,#20046) +regexp_const_value(#20045,"/") +#20047=* +regexpterm(#20047,14,#20031,1,"mailto:") +#20048=@"loc,{#10000},1,33,1,39" +locations_default(#20048,#10000,1,33,1,39) +hasLocation(#20047,#20048) +regexp_const_value(#20047,"mailto:") +#20049=* +regexpterm(#20049,1,#20031,2,"www\.") +#20050=@"loc,{#10000},1,41,1,45" +locations_default(#20050,#10000,1,41,1,45) +hasLocation(#20049,#20050) +#20051=* +regexpterm(#20051,14,#20049,0,"www") +#20052=@"loc,{#10000},1,41,1,43" +locations_default(#20052,#10000,1,41,1,43) +hasLocation(#20051,#20052) +regexp_const_value(#20051,"www") +#20053=* +regexpterm(#20053,21,#20049,1,"\.") +#20054=@"loc,{#10000},1,44,1,45" +locations_default(#20054,#10000,1,44,1,45) +hasLocation(#20053,#20054) +regexp_const_value(#20053,".") +#20055=* +regexpterm(#20055,9,#20025,2,"(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+") +#20056=@"loc,{#10000},1,47,1,98" +locations_default(#20056,#10000,1,47,1,98) +hasLocation(#20055,#20056) +is_greedy(#20055) +#20057=* +regexpterm(#20057,13,#20055,0,"(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])") +#20058=@"loc,{#10000},1,47,1,97" +locations_default(#20058,#10000,1,47,1,97) +hasLocation(#20057,#20058) +#20059=* +regexpterm(#20059,0,#20057,0,"[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]]") +#20060=@"loc,{#10000},1,50,1,96" +locations_default(#20060,#10000,1,50,1,96) +hasLocation(#20059,#20060) +#20061=* +regexpterm(#20061,23,#20059,0,"[\S--[\p{P}<>]]") +#20062=@"loc,{#10000},1,50,1,64" +locations_default(#20062,#10000,1,50,1,64) +hasLocation(#20061,#20062) +#20063=* +regexpterm(#20063,30,#20061,0,"[\S--[\p{P}<>]]") +hasLocation(#20063,#20062) +#20064=* +regexpterm(#20064,20,#20063,0,"\S") +#20065=@"loc,{#10000},1,51,1,52" +locations_default(#20065,#10000,1,51,1,52) +hasLocation(#20064,#20065) +char_class_escape(#20064,"S") +#20066=* +regexpterm(#20066,23,#20063,1,"[\p{P}<>]") +#20067=@"loc,{#10000},1,55,1,63" +locations_default(#20067,#10000,1,55,1,63) +hasLocation(#20066,#20067) +#20068=* +regexpterm(#20068,31,#20066,0,"[\p{P}<>]") +hasLocation(#20068,#20067) +#20069=* +regexpterm(#20069,27,#20068,0,"\p{P}") +#20070=@"loc,{#10000},1,56,1,60" +locations_default(#20070,#10000,1,56,1,60) +hasLocation(#20069,#20070) +unicode_property_escapename(#20069,"P") +#20071=* +regexpterm(#20071,14,#20068,1,"<") +#20072=@"loc,{#10000},1,61,1,61" +locations_default(#20072,#10000,1,61,1,61) +hasLocation(#20071,#20072) +regexp_const_value(#20071,"<") +#20073=* +regexpterm(#20073,14,#20068,2,">") +#20074=@"loc,{#10000},1,62,1,62" +locations_default(#20074,#10000,1,62,1,62) +hasLocation(#20073,#20074) +regexp_const_value(#20073,">") +#20075=* +regexpterm(#20075,21,#20059,1,"\/") +#20076=@"loc,{#10000},1,66,1,67" +locations_default(#20076,#10000,1,66,1,67) +hasLocation(#20075,#20076) +regexp_const_value(#20075,"/") +#20077=* +regexpterm(#20077,1,#20059,2,"[\S--[\[\]]]+[\S--[\p{P}<>]]") +#20078=@"loc,{#10000},1,69,1,96" +locations_default(#20078,#10000,1,69,1,96) +hasLocation(#20077,#20078) +#20079=* +regexpterm(#20079,9,#20077,0,"[\S--[\[\]]]+") +#20080=@"loc,{#10000},1,69,1,81" +locations_default(#20080,#10000,1,69,1,81) +hasLocation(#20079,#20080) +is_greedy(#20079) +#20081=* +regexpterm(#20081,23,#20079,0,"[\S--[\[\]]]") +#20082=@"loc,{#10000},1,69,1,80" +locations_default(#20082,#10000,1,69,1,80) +hasLocation(#20081,#20082) +#20083=* +regexpterm(#20083,30,#20081,0,"[\S--[\[\]]]") +hasLocation(#20083,#20082) +#20084=* +regexpterm(#20084,20,#20083,0,"\S") +#20085=@"loc,{#10000},1,70,1,71" +locations_default(#20085,#10000,1,70,1,71) +hasLocation(#20084,#20085) +char_class_escape(#20084,"S") +#20086=* +regexpterm(#20086,23,#20083,1,"[\[\]]") +#20087=@"loc,{#10000},1,74,1,79" +locations_default(#20087,#10000,1,74,1,79) +hasLocation(#20086,#20087) +#20088=* +regexpterm(#20088,21,#20086,0,"\[") +#20089=@"loc,{#10000},1,75,1,76" +locations_default(#20089,#10000,1,75,1,76) +hasLocation(#20088,#20089) +regexp_const_value(#20088,"[") +#20090=* +regexpterm(#20090,21,#20086,1,"\]") +#20091=@"loc,{#10000},1,77,1,78" +locations_default(#20091,#10000,1,77,1,78) +hasLocation(#20090,#20091) +regexp_const_value(#20090,"]") +#20092=* +regexpterm(#20092,23,#20077,1,"[\S--[\p{P}<>]]") +#20093=@"loc,{#10000},1,82,1,96" +locations_default(#20093,#10000,1,82,1,96) +hasLocation(#20092,#20093) +#20094=* +regexpterm(#20094,30,#20092,0,"[\S--[\p{P}<>]]") +hasLocation(#20094,#20093) +#20095=* +regexpterm(#20095,20,#20094,0,"\S") +#20096=@"loc,{#10000},1,83,1,84" +locations_default(#20096,#10000,1,83,1,84) +hasLocation(#20095,#20096) +char_class_escape(#20095,"S") +#20097=* +regexpterm(#20097,23,#20094,1,"[\p{P}<>]") +#20098=@"loc,{#10000},1,87,1,95" +locations_default(#20098,#10000,1,87,1,95) +hasLocation(#20097,#20098) +#20099=* +regexpterm(#20099,31,#20097,0,"[\p{P}<>]") +hasLocation(#20099,#20098) +#20100=* +regexpterm(#20100,27,#20099,0,"\p{P}") +#20101=@"loc,{#10000},1,88,1,92" +locations_default(#20101,#10000,1,88,1,92) +hasLocation(#20100,#20101) +unicode_property_escapename(#20100,"P") +#20102=* +regexpterm(#20102,14,#20099,1,"<") +#20103=@"loc,{#10000},1,93,1,93" +locations_default(#20103,#10000,1,93,1,93) +hasLocation(#20102,#20103) +regexp_const_value(#20102,"<") +#20104=* +regexpterm(#20104,14,#20099,2,">") +#20105=@"loc,{#10000},1,94,1,94" +locations_default(#20105,#10000,1,94,1,94) +hasLocation(#20104,#20105) +regexp_const_value(#20104,">") +#20106=* +regexpterm(#20106,1,#20023,1,"\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)") +#20107=@"loc,{#10000},1,100,1,167" +locations_default(#20107,#10000,1,100,1,167) +hasLocation(#20106,#20107) +#20108=* +regexpterm(#20108,4,#20106,0,"\b") +#20109=@"loc,{#10000},1,100,1,101" +locations_default(#20109,#10000,1,100,1,101) +hasLocation(#20108,#20109) +#20110=* +regexpterm(#20110,9,#20106,1,"[\S--[@\p{Ps}\p{Pe}<>]]+") +#20111=@"loc,{#10000},1,102,1,125" +locations_default(#20111,#10000,1,102,1,125) +hasLocation(#20110,#20111) +is_greedy(#20110) +#20112=* +regexpterm(#20112,23,#20110,0,"[\S--[@\p{Ps}\p{Pe}<>]]") +#20113=@"loc,{#10000},1,102,1,124" +locations_default(#20113,#10000,1,102,1,124) +hasLocation(#20112,#20113) +#20114=* +regexpterm(#20114,30,#20112,0,"[\S--[@\p{Ps}\p{Pe}<>]]") +hasLocation(#20114,#20113) +#20115=* +regexpterm(#20115,20,#20114,0,"\S") +#20116=@"loc,{#10000},1,103,1,104" +locations_default(#20116,#10000,1,103,1,104) +hasLocation(#20115,#20116) +char_class_escape(#20115,"S") +#20117=* +regexpterm(#20117,23,#20114,1,"[@\p{Ps}\p{Pe}<>]") +#20118=@"loc,{#10000},1,107,1,123" +locations_default(#20118,#10000,1,107,1,123) +hasLocation(#20117,#20118) +#20119=* +regexpterm(#20119,31,#20117,0,"[@\p{Ps}\p{Pe}<>]") +hasLocation(#20119,#20118) +#20120=* +regexpterm(#20120,14,#20119,0,"@") +#20121=@"loc,{#10000},1,108,1,108" +locations_default(#20121,#10000,1,108,1,108) +hasLocation(#20120,#20121) +regexp_const_value(#20120,"@") +#20122=* +regexpterm(#20122,27,#20119,1,"\p{Ps}") +#20123=@"loc,{#10000},1,109,1,114" +locations_default(#20123,#10000,1,109,1,114) +hasLocation(#20122,#20123) +unicode_property_escapename(#20122,"Ps") +#20124=* +regexpterm(#20124,27,#20119,2,"\p{Pe}") +#20125=@"loc,{#10000},1,115,1,120" +locations_default(#20125,#10000,1,115,1,120) +hasLocation(#20124,#20125) +unicode_property_escapename(#20124,"Pe") +#20126=* +regexpterm(#20126,14,#20119,3,"<") +#20127=@"loc,{#10000},1,121,1,121" +locations_default(#20127,#10000,1,121,1,121) +hasLocation(#20126,#20127) +regexp_const_value(#20126,"<") +#20128=* +regexpterm(#20128,14,#20119,4,">") +#20129=@"loc,{#10000},1,122,1,122" +locations_default(#20129,#10000,1,122,1,122) +hasLocation(#20128,#20129) +regexp_const_value(#20128,">") +#20130=* +regexpterm(#20130,14,#20106,2,"@") +#20131=@"loc,{#10000},1,126,1,126" +locations_default(#20131,#10000,1,126,1,126) +hasLocation(#20130,#20131) +regexp_const_value(#20130,"@") +#20132=* +regexpterm(#20132,13,#20106,3,"([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)") +#20133=@"loc,{#10000},1,127,1,167" +locations_default(#20133,#10000,1,127,1,167) +hasLocation(#20132,#20133) +is_capture(#20132,1) +#20134=* +regexpterm(#20134,1,#20132,0,"[\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+") +#20135=@"loc,{#10000},1,128,1,166" +locations_default(#20135,#10000,1,128,1,166) +hasLocation(#20134,#20135) +#20136=* +regexpterm(#20136,9,#20134,0,"[\S--[\p{P}<>]]+") +#20137=@"loc,{#10000},1,128,1,143" +locations_default(#20137,#10000,1,128,1,143) +hasLocation(#20136,#20137) +is_greedy(#20136) +#20138=* +regexpterm(#20138,23,#20136,0,"[\S--[\p{P}<>]]") +#20139=@"loc,{#10000},1,128,1,142" +locations_default(#20139,#10000,1,128,1,142) +hasLocation(#20138,#20139) +#20140=* +regexpterm(#20140,30,#20138,0,"[\S--[\p{P}<>]]") +hasLocation(#20140,#20139) +#20141=* +regexpterm(#20141,20,#20140,0,"\S") +#20142=@"loc,{#10000},1,129,1,130" +locations_default(#20142,#10000,1,129,1,130) +hasLocation(#20141,#20142) +char_class_escape(#20141,"S") +#20143=* +regexpterm(#20143,23,#20140,1,"[\p{P}<>]") +#20144=@"loc,{#10000},1,133,1,141" +locations_default(#20144,#10000,1,133,1,141) +hasLocation(#20143,#20144) +#20145=* +regexpterm(#20145,31,#20143,0,"[\p{P}<>]") +hasLocation(#20145,#20144) +#20146=* +regexpterm(#20146,27,#20145,0,"\p{P}") +#20147=@"loc,{#10000},1,134,1,138" +locations_default(#20147,#10000,1,134,1,138) +hasLocation(#20146,#20147) +unicode_property_escapename(#20146,"P") +#20148=* +regexpterm(#20148,14,#20145,1,"<") +#20149=@"loc,{#10000},1,139,1,139" +locations_default(#20149,#10000,1,139,1,139) +hasLocation(#20148,#20149) +regexp_const_value(#20148,"<") +#20150=* +regexpterm(#20150,14,#20145,2,">") +#20151=@"loc,{#10000},1,140,1,140" +locations_default(#20151,#10000,1,140,1,140) +hasLocation(#20150,#20151) +regexp_const_value(#20150,">") +#20152=* +regexpterm(#20152,9,#20134,1,"(?:\.[\S--[\p{P}<>]]+)+") +#20153=@"loc,{#10000},1,144,1,166" +locations_default(#20153,#10000,1,144,1,166) +hasLocation(#20152,#20153) +is_greedy(#20152) +#20154=* +regexpterm(#20154,13,#20152,0,"(?:\.[\S--[\p{P}<>]]+)") +#20155=@"loc,{#10000},1,144,1,165" +locations_default(#20155,#10000,1,144,1,165) +hasLocation(#20154,#20155) +#20156=* +regexpterm(#20156,1,#20154,0,"\.[\S--[\p{P}<>]]+") +#20157=@"loc,{#10000},1,147,1,164" +locations_default(#20157,#10000,1,147,1,164) +hasLocation(#20156,#20157) +#20158=* +regexpterm(#20158,21,#20156,0,"\.") +#20159=@"loc,{#10000},1,147,1,148" +locations_default(#20159,#10000,1,147,1,148) +hasLocation(#20158,#20159) +regexp_const_value(#20158,".") +#20160=* +regexpterm(#20160,9,#20156,1,"[\S--[\p{P}<>]]+") +#20161=@"loc,{#10000},1,149,1,164" +locations_default(#20161,#10000,1,149,1,164) +hasLocation(#20160,#20161) +is_greedy(#20160) +#20162=* +regexpterm(#20162,23,#20160,0,"[\S--[\p{P}<>]]") +#20163=@"loc,{#10000},1,149,1,163" +locations_default(#20163,#10000,1,149,1,163) +hasLocation(#20162,#20163) +#20164=* +regexpterm(#20164,30,#20162,0,"[\S--[\p{P}<>]]") +hasLocation(#20164,#20163) +#20165=* +regexpterm(#20165,20,#20164,0,"\S") +#20166=@"loc,{#10000},1,150,1,151" +locations_default(#20166,#10000,1,150,1,151) +hasLocation(#20165,#20166) +char_class_escape(#20165,"S") +#20167=* +regexpterm(#20167,23,#20164,1,"[\p{P}<>]") +#20168=@"loc,{#10000},1,154,1,162" +locations_default(#20168,#10000,1,154,1,162) +hasLocation(#20167,#20168) +#20169=* +regexpterm(#20169,31,#20167,0,"[\p{P}<>]") +hasLocation(#20169,#20168) +#20170=* +regexpterm(#20170,27,#20169,0,"\p{P}") +#20171=@"loc,{#10000},1,155,1,159" +locations_default(#20171,#10000,1,155,1,159) +hasLocation(#20170,#20171) +unicode_property_escapename(#20170,"P") +#20172=* +regexpterm(#20172,14,#20169,1,"<") +#20173=@"loc,{#10000},1,160,1,160" +locations_default(#20173,#10000,1,160,1,160) +hasLocation(#20172,#20173) +regexp_const_value(#20172,"<") +#20174=* +regexpterm(#20174,14,#20169,2,">") +#20175=@"loc,{#10000},1,161,1,161" +locations_default(#20175,#10000,1,161,1,161) +hasLocation(#20174,#20175) +regexp_const_value(#20174,">") +#20176=* +entry_cfg_node(#20176,#20001) +#20177=@"loc,{#10000},1,1,1,0" +locations_default(#20177,#10000,1,1,1,0) +hasLocation(#20176,#20177) +#20178=* +exit_cfg_node(#20178,#20001) +hasLocation(#20178,#20015) +successor(#20018,#20021) +successor(#20022,#20019) +successor(#20021,#20022) +successor(#20019,#20178) +successor(#20176,#20018) +numlines(#10000,1,1,0) +filetype(#10000,"javascript") diff --git a/javascript/ql/test/query-tests/RegExp/DuplicateCharacterInCharacterClass/tst.js b/javascript/ql/test/query-tests/RegExp/DuplicateCharacterInCharacterClass/tst.js index 59114b90c54a..82c0ebcd566d 100644 --- a/javascript/ql/test/query-tests/RegExp/DuplicateCharacterInCharacterClass/tst.js +++ b/javascript/ql/test/query-tests/RegExp/DuplicateCharacterInCharacterClass/tst.js @@ -11,3 +11,4 @@ /[\u{ff}]/; /[\u{12340}-\u{12345}]/u; // OK new RegExp("[\u{12340}-\u{12345}]", "u"); // OK +const regex = /\b(?:https?:\/\/|mailto:|www\.)(?:[\S--[\p{P}<>]]|\/|[\S--[\[\]]]+[\S--[\p{P}<>]])+|\b[\S--[@\p{Ps}\p{Pe}<>]]+@([\S--[\p{P}<>]]+(?:\.[\S--[\p{P}<>]]+)+)/gmv;