-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a test case regex with not known flags.
- Loading branch information
Showing
2 changed files
with
284 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
javascript/extractor/tests/es2024/input/regex_with_not_known_flags.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const regex = new RegExp(/[[abc]&&[[bcd]--[[c][d]]]]/, notKnownFlags); |
283 changes: 283 additions & 0 deletions
283
javascript/extractor/tests/es2024/output/trap/regex_with_not_known_flags.js.trap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,283 @@ | ||
#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 = new RegExp(/[[abc]&&[[bcd]--[[c][d]]]]/, notKnownFlags); "," | ||
") | ||
#20003=@"loc,{#10000},1,1,1,71" | ||
locations_default(#20003,#10000,1,1,1,71) | ||
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,7,#20001,3,"new") | ||
#20011=@"loc,{#10000},1,15,1,17" | ||
locations_default(#20011,#10000,1,15,1,17) | ||
hasLocation(#20010,#20011) | ||
#20012=* | ||
tokeninfo(#20012,6,#20001,4,"RegExp") | ||
#20013=@"loc,{#10000},1,19,1,24" | ||
locations_default(#20013,#10000,1,19,1,24) | ||
hasLocation(#20012,#20013) | ||
#20014=* | ||
tokeninfo(#20014,8,#20001,5,"(") | ||
#20015=@"loc,{#10000},1,25,1,25" | ||
locations_default(#20015,#10000,1,25,1,25) | ||
hasLocation(#20014,#20015) | ||
#20016=* | ||
tokeninfo(#20016,5,#20001,6,"/[[abc]&&[[bcd]--[[c][d]]]]/") | ||
#20017=@"loc,{#10000},1,26,1,53" | ||
locations_default(#20017,#10000,1,26,1,53) | ||
hasLocation(#20016,#20017) | ||
#20018=* | ||
tokeninfo(#20018,8,#20001,7,",") | ||
#20019=@"loc,{#10000},1,54,1,54" | ||
locations_default(#20019,#10000,1,54,1,54) | ||
hasLocation(#20018,#20019) | ||
#20020=* | ||
tokeninfo(#20020,6,#20001,8,"notKnownFlags") | ||
#20021=@"loc,{#10000},1,56,1,68" | ||
locations_default(#20021,#10000,1,56,1,68) | ||
hasLocation(#20020,#20021) | ||
#20022=* | ||
tokeninfo(#20022,8,#20001,9,")") | ||
#20023=@"loc,{#10000},1,69,1,69" | ||
locations_default(#20023,#10000,1,69,1,69) | ||
hasLocation(#20022,#20023) | ||
#20024=* | ||
tokeninfo(#20024,8,#20001,10,";") | ||
#20025=@"loc,{#10000},1,70,1,70" | ||
locations_default(#20025,#10000,1,70,1,70) | ||
hasLocation(#20024,#20025) | ||
#20026=* | ||
tokeninfo(#20026,0,#20001,11,"") | ||
#20027=@"loc,{#10000},2,1,2,0" | ||
locations_default(#20027,#10000,2,1,2,0) | ||
hasLocation(#20026,#20027) | ||
toplevels(#20001,0) | ||
#20028=@"loc,{#10000},1,1,2,0" | ||
locations_default(#20028,#10000,1,1,2,0) | ||
hasLocation(#20001,#20028) | ||
#20029=@"var;{regex};{#20000}" | ||
variables(#20029,"regex",#20000) | ||
#20030=* | ||
stmts(#20030,22,#20001,0,"const r ... Flags);") | ||
#20031=@"loc,{#10000},1,1,1,70" | ||
locations_default(#20031,#10000,1,1,1,70) | ||
hasLocation(#20030,#20031) | ||
stmt_containers(#20030,#20001) | ||
#20032=* | ||
exprs(#20032,64,#20030,0,"regex = ... nFlags)") | ||
#20033=@"loc,{#10000},1,7,1,69" | ||
locations_default(#20033,#10000,1,7,1,69) | ||
hasLocation(#20032,#20033) | ||
enclosing_stmt(#20032,#20030) | ||
expr_containers(#20032,#20001) | ||
#20034=* | ||
exprs(#20034,78,#20032,0,"regex") | ||
hasLocation(#20034,#20007) | ||
enclosing_stmt(#20034,#20030) | ||
expr_containers(#20034,#20001) | ||
literals("regex","regex",#20034) | ||
decl(#20034,#20029) | ||
#20035=* | ||
exprs(#20035,12,#20032,1,"new Reg ... nFlags)") | ||
#20036=@"loc,{#10000},1,15,1,69" | ||
locations_default(#20036,#10000,1,15,1,69) | ||
hasLocation(#20035,#20036) | ||
enclosing_stmt(#20035,#20030) | ||
expr_containers(#20035,#20001) | ||
#20037=* | ||
exprs(#20037,79,#20035,-1,"RegExp") | ||
hasLocation(#20037,#20013) | ||
enclosing_stmt(#20037,#20030) | ||
expr_containers(#20037,#20001) | ||
literals("RegExp","RegExp",#20037) | ||
#20038=@"var;{RegExp};{#20000}" | ||
variables(#20038,"RegExp",#20000) | ||
bind(#20037,#20038) | ||
#20039=* | ||
exprs(#20039,5,#20035,0,"/[[abc] ... [d]]]]/") | ||
hasLocation(#20039,#20017) | ||
enclosing_stmt(#20039,#20030) | ||
expr_containers(#20039,#20001) | ||
literals("/[[abc]&&[[bcd]--[[c][d]]]]/","/[[abc]&&[[bcd]--[[c][d]]]]/",#20039) | ||
#20040=* | ||
regexpterm(#20040,1,#20039,0,"[[abc]&&[[bcd]--[[c][d]]]]") | ||
#20041=@"loc,{#10000},1,27,1,52" | ||
locations_default(#20041,#10000,1,27,1,52) | ||
hasLocation(#20040,#20041) | ||
#20042=* | ||
regexpterm(#20042,23,#20040,0,"[[abc]") | ||
#20043=@"loc,{#10000},1,27,1,32" | ||
locations_default(#20043,#10000,1,27,1,32) | ||
hasLocation(#20042,#20043) | ||
#20044=* | ||
regexpterm(#20044,14,#20042,0,"[") | ||
#20045=@"loc,{#10000},1,28,1,28" | ||
locations_default(#20045,#10000,1,28,1,28) | ||
hasLocation(#20044,#20045) | ||
regexp_const_value(#20044,"[") | ||
#20046=* | ||
regexpterm(#20046,14,#20042,1,"a") | ||
#20047=@"loc,{#10000},1,29,1,29" | ||
locations_default(#20047,#10000,1,29,1,29) | ||
hasLocation(#20046,#20047) | ||
regexp_const_value(#20046,"a") | ||
#20048=* | ||
regexpterm(#20048,14,#20042,2,"b") | ||
#20049=@"loc,{#10000},1,30,1,30" | ||
locations_default(#20049,#10000,1,30,1,30) | ||
hasLocation(#20048,#20049) | ||
regexp_const_value(#20048,"b") | ||
#20050=* | ||
regexpterm(#20050,14,#20042,3,"c") | ||
#20051=@"loc,{#10000},1,31,1,31" | ||
locations_default(#20051,#10000,1,31,1,31) | ||
hasLocation(#20050,#20051) | ||
regexp_const_value(#20050,"c") | ||
#20052=* | ||
regexpterm(#20052,14,#20040,1,"&&") | ||
#20053=@"loc,{#10000},1,33,1,34" | ||
locations_default(#20053,#10000,1,33,1,34) | ||
hasLocation(#20052,#20053) | ||
regexp_const_value(#20052,"&&") | ||
#20054=* | ||
regexpterm(#20054,23,#20040,2,"[[bcd]") | ||
#20055=@"loc,{#10000},1,35,1,40" | ||
locations_default(#20055,#10000,1,35,1,40) | ||
hasLocation(#20054,#20055) | ||
#20056=* | ||
regexpterm(#20056,14,#20054,0,"[") | ||
#20057=@"loc,{#10000},1,36,1,36" | ||
locations_default(#20057,#10000,1,36,1,36) | ||
hasLocation(#20056,#20057) | ||
regexp_const_value(#20056,"[") | ||
#20058=* | ||
regexpterm(#20058,14,#20054,1,"b") | ||
#20059=@"loc,{#10000},1,37,1,37" | ||
locations_default(#20059,#10000,1,37,1,37) | ||
hasLocation(#20058,#20059) | ||
regexp_const_value(#20058,"b") | ||
#20060=* | ||
regexpterm(#20060,14,#20054,2,"c") | ||
#20061=@"loc,{#10000},1,38,1,38" | ||
locations_default(#20061,#10000,1,38,1,38) | ||
hasLocation(#20060,#20061) | ||
regexp_const_value(#20060,"c") | ||
#20062=* | ||
regexpterm(#20062,14,#20054,3,"d") | ||
#20063=@"loc,{#10000},1,39,1,39" | ||
locations_default(#20063,#10000,1,39,1,39) | ||
hasLocation(#20062,#20063) | ||
regexp_const_value(#20062,"d") | ||
#20064=* | ||
regexpterm(#20064,14,#20040,3,"--") | ||
#20065=@"loc,{#10000},1,41,1,42" | ||
locations_default(#20065,#10000,1,41,1,42) | ||
hasLocation(#20064,#20065) | ||
regexp_const_value(#20064,"--") | ||
#20066=* | ||
regexpterm(#20066,23,#20040,4,"[[c]") | ||
#20067=@"loc,{#10000},1,43,1,46" | ||
locations_default(#20067,#10000,1,43,1,46) | ||
hasLocation(#20066,#20067) | ||
#20068=* | ||
regexpterm(#20068,14,#20066,0,"[") | ||
#20069=@"loc,{#10000},1,44,1,44" | ||
locations_default(#20069,#10000,1,44,1,44) | ||
hasLocation(#20068,#20069) | ||
regexp_const_value(#20068,"[") | ||
#20070=* | ||
regexpterm(#20070,14,#20066,1,"c") | ||
#20071=@"loc,{#10000},1,45,1,45" | ||
locations_default(#20071,#10000,1,45,1,45) | ||
hasLocation(#20070,#20071) | ||
regexp_const_value(#20070,"c") | ||
#20072=* | ||
regexpterm(#20072,23,#20040,5,"[d]") | ||
#20073=@"loc,{#10000},1,47,1,49" | ||
locations_default(#20073,#10000,1,47,1,49) | ||
hasLocation(#20072,#20073) | ||
#20074=* | ||
regexpterm(#20074,14,#20072,0,"d") | ||
#20075=@"loc,{#10000},1,48,1,48" | ||
locations_default(#20075,#10000,1,48,1,48) | ||
hasLocation(#20074,#20075) | ||
regexp_const_value(#20074,"d") | ||
#20076=* | ||
regexpterm(#20076,14,#20040,6,"]") | ||
#20077=@"loc,{#10000},1,50,1,50" | ||
locations_default(#20077,#10000,1,50,1,50) | ||
hasLocation(#20076,#20077) | ||
regexp_const_value(#20076,"]") | ||
#20078=* | ||
regexpterm(#20078,14,#20040,7,"]") | ||
#20079=@"loc,{#10000},1,51,1,51" | ||
locations_default(#20079,#10000,1,51,1,51) | ||
hasLocation(#20078,#20079) | ||
regexp_const_value(#20078,"]") | ||
#20080=* | ||
regexpterm(#20080,14,#20040,8,"]") | ||
#20081=@"loc,{#10000},1,52,1,52" | ||
locations_default(#20081,#10000,1,52,1,52) | ||
hasLocation(#20080,#20081) | ||
regexp_const_value(#20080,"]") | ||
#20082=* | ||
regexp_parse_errors(#20082,#20040,"unexpected character") | ||
hasLocation(#20082,#20077) | ||
#20083=* | ||
regexp_parse_errors(#20083,#20040,"unexpected character") | ||
hasLocation(#20083,#20079) | ||
#20084=* | ||
regexp_parse_errors(#20084,#20040,"unexpected character") | ||
hasLocation(#20084,#20081) | ||
#20085=* | ||
exprs(#20085,79,#20035,1,"notKnownFlags") | ||
hasLocation(#20085,#20021) | ||
enclosing_stmt(#20085,#20030) | ||
expr_containers(#20085,#20001) | ||
literals("notKnownFlags","notKnownFlags",#20085) | ||
#20086=@"var;{notKnownFlags};{#20000}" | ||
variables(#20086,"notKnownFlags",#20000) | ||
bind(#20085,#20086) | ||
#20087=* | ||
entry_cfg_node(#20087,#20001) | ||
#20088=@"loc,{#10000},1,1,1,0" | ||
locations_default(#20088,#10000,1,1,1,0) | ||
hasLocation(#20087,#20088) | ||
#20089=* | ||
exit_cfg_node(#20089,#20001) | ||
hasLocation(#20089,#20027) | ||
successor(#20030,#20034) | ||
successor(#20085,#20035) | ||
successor(#20039,#20085) | ||
successor(#20037,#20039) | ||
successor(#20035,#20032) | ||
successor(#20034,#20037) | ||
successor(#20032,#20089) | ||
successor(#20087,#20030) | ||
numlines(#10000,1,1,0) | ||
filetype(#10000,"javascript") |