Skip to content

Commit ac6b9d1

Browse files
committed
JS: add TRAP test with closure modules
1 parent cac09cf commit ac6b9d1

6 files changed

Lines changed: 700 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
goog.declareModuleId('test');
2+
3+
export let x = 5;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
goog.module('test');
2+
var x = 5;
3+
exports = { x: x };
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
goog.provide('test.x');
2+
3+
test.x = 5;
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
#10000=@"/googDotDeclareModuleId.js;sourcefile"
2+
files(#10000,"/googDotDeclareModuleId.js","googDotDeclareModuleId","js",0)
3+
#10001=@"/;folder"
4+
folders(#10001,"/","")
5+
containerparent(#10001,#10000)
6+
#10002=@"loc,{#10000},0,0,0,0"
7+
locations_default(#10002,#10000,0,0,0,0)
8+
hasLocation(#10000,#10002)
9+
#20000=@"global_scope"
10+
scopes(#20000,0)
11+
#20001=@"script;{#10000},1,1"
12+
toplevels(#20001,0)
13+
#20002=@"loc,{#10000},1,1,4,0"
14+
locations_default(#20002,#10000,1,1,4,0)
15+
hasLocation(#20001,#20002)
16+
#20003=@"module;{#10000},1,1"
17+
scopes(#20003,3)
18+
scopenodes(#20001,#20003)
19+
scopenesting(#20003,#20000)
20+
isES2015Module(#20001)
21+
isModule(#20001)
22+
#20004=@"var;{x};{#20003}"
23+
variables(#20004,"x",#20003)
24+
#20005=*
25+
stmts(#20005,2,#20001,0,"goog.de ... test');")
26+
#20006=@"loc,{#10000},1,1,1,29"
27+
locations_default(#20006,#10000,1,1,1,29)
28+
hasLocation(#20005,#20006)
29+
stmtContainers(#20005,#20001)
30+
#20007=*
31+
exprs(#20007,13,#20005,0,"goog.de ... 'test')")
32+
#20008=@"loc,{#10000},1,1,1,28"
33+
locations_default(#20008,#10000,1,1,1,28)
34+
hasLocation(#20007,#20008)
35+
enclosingStmt(#20007,#20005)
36+
exprContainers(#20007,#20001)
37+
#20009=*
38+
exprs(#20009,14,#20007,-1,"goog.declareModuleId")
39+
#20010=@"loc,{#10000},1,1,1,20"
40+
locations_default(#20010,#10000,1,1,1,20)
41+
hasLocation(#20009,#20010)
42+
enclosingStmt(#20009,#20005)
43+
exprContainers(#20009,#20001)
44+
#20011=*
45+
exprs(#20011,79,#20009,0,"goog")
46+
#20012=@"loc,{#10000},1,1,1,4"
47+
locations_default(#20012,#10000,1,1,1,4)
48+
hasLocation(#20011,#20012)
49+
enclosingStmt(#20011,#20005)
50+
exprContainers(#20011,#20001)
51+
literals("goog","goog",#20011)
52+
#20013=@"var;{goog};{#20000}"
53+
variables(#20013,"goog",#20000)
54+
bind(#20011,#20013)
55+
#20014=*
56+
exprs(#20014,0,#20009,1,"declareModuleId")
57+
#20015=@"loc,{#10000},1,6,1,20"
58+
locations_default(#20015,#10000,1,6,1,20)
59+
hasLocation(#20014,#20015)
60+
enclosingStmt(#20014,#20005)
61+
exprContainers(#20014,#20001)
62+
literals("declareModuleId","declareModuleId",#20014)
63+
#20016=*
64+
exprs(#20016,4,#20007,0,"'test'")
65+
#20017=@"loc,{#10000},1,22,1,27"
66+
locations_default(#20017,#10000,1,22,1,27)
67+
hasLocation(#20016,#20017)
68+
enclosingStmt(#20016,#20005)
69+
exprContainers(#20016,#20001)
70+
literals("test","'test'",#20016)
71+
#20018=*
72+
stmts(#20018,30,#20001,1,"export let x = 5;")
73+
#20019=@"loc,{#10000},3,1,3,17"
74+
locations_default(#20019,#10000,3,1,3,17)
75+
hasLocation(#20018,#20019)
76+
stmtContainers(#20018,#20001)
77+
#20020=*
78+
stmts(#20020,23,#20018,-1,"let x = 5;")
79+
#20021=@"loc,{#10000},3,8,3,17"
80+
locations_default(#20021,#10000,3,8,3,17)
81+
hasLocation(#20020,#20021)
82+
stmtContainers(#20020,#20001)
83+
#20022=*
84+
exprs(#20022,64,#20020,0,"x = 5")
85+
#20023=@"loc,{#10000},3,12,3,16"
86+
locations_default(#20023,#10000,3,12,3,16)
87+
hasLocation(#20022,#20023)
88+
enclosingStmt(#20022,#20020)
89+
exprContainers(#20022,#20001)
90+
#20024=*
91+
exprs(#20024,78,#20022,0,"x")
92+
#20025=@"loc,{#10000},3,12,3,12"
93+
locations_default(#20025,#10000,3,12,3,12)
94+
hasLocation(#20024,#20025)
95+
enclosingStmt(#20024,#20020)
96+
exprContainers(#20024,#20001)
97+
literals("x","x",#20024)
98+
decl(#20024,#20004)
99+
#20026=*
100+
exprs(#20026,3,#20022,1,"5")
101+
#20027=@"loc,{#10000},3,16,3,16"
102+
locations_default(#20027,#10000,3,16,3,16)
103+
hasLocation(#20026,#20027)
104+
enclosingStmt(#20026,#20020)
105+
exprContainers(#20026,#20001)
106+
literals("5","5",#20026)
107+
#20028=*
108+
lines(#20028,#20001,"goog.declareModuleId('test');","
109+
")
110+
hasLocation(#20028,#20006)
111+
#20029=*
112+
lines(#20029,#20001,"","
113+
")
114+
#20030=@"loc,{#10000},2,1,2,0"
115+
locations_default(#20030,#10000,2,1,2,0)
116+
hasLocation(#20029,#20030)
117+
#20031=*
118+
lines(#20031,#20001,"export let x = 5;","
119+
")
120+
hasLocation(#20031,#20019)
121+
numlines(#20001,3,2,0)
122+
#20032=*
123+
tokeninfo(#20032,6,#20001,0,"goog")
124+
hasLocation(#20032,#20012)
125+
#20033=*
126+
tokeninfo(#20033,8,#20001,1,".")
127+
#20034=@"loc,{#10000},1,5,1,5"
128+
locations_default(#20034,#10000,1,5,1,5)
129+
hasLocation(#20033,#20034)
130+
#20035=*
131+
tokeninfo(#20035,6,#20001,2,"declareModuleId")
132+
hasLocation(#20035,#20015)
133+
#20036=*
134+
tokeninfo(#20036,8,#20001,3,"(")
135+
#20037=@"loc,{#10000},1,21,1,21"
136+
locations_default(#20037,#10000,1,21,1,21)
137+
hasLocation(#20036,#20037)
138+
#20038=*
139+
tokeninfo(#20038,4,#20001,4,"'test'")
140+
hasLocation(#20038,#20017)
141+
#20039=*
142+
tokeninfo(#20039,8,#20001,5,")")
143+
#20040=@"loc,{#10000},1,28,1,28"
144+
locations_default(#20040,#10000,1,28,1,28)
145+
hasLocation(#20039,#20040)
146+
#20041=*
147+
tokeninfo(#20041,8,#20001,6,";")
148+
#20042=@"loc,{#10000},1,29,1,29"
149+
locations_default(#20042,#10000,1,29,1,29)
150+
hasLocation(#20041,#20042)
151+
#20043=*
152+
tokeninfo(#20043,7,#20001,7,"export")
153+
#20044=@"loc,{#10000},3,1,3,6"
154+
locations_default(#20044,#10000,3,1,3,6)
155+
hasLocation(#20043,#20044)
156+
#20045=*
157+
tokeninfo(#20045,7,#20001,8,"let")
158+
#20046=@"loc,{#10000},3,8,3,10"
159+
locations_default(#20046,#10000,3,8,3,10)
160+
hasLocation(#20045,#20046)
161+
#20047=*
162+
tokeninfo(#20047,6,#20001,9,"x")
163+
hasLocation(#20047,#20025)
164+
#20048=*
165+
tokeninfo(#20048,8,#20001,10,"=")
166+
#20049=@"loc,{#10000},3,14,3,14"
167+
locations_default(#20049,#10000,3,14,3,14)
168+
hasLocation(#20048,#20049)
169+
#20050=*
170+
tokeninfo(#20050,3,#20001,11,"5")
171+
hasLocation(#20050,#20027)
172+
#20051=*
173+
tokeninfo(#20051,8,#20001,12,";")
174+
#20052=@"loc,{#10000},3,17,3,17"
175+
locations_default(#20052,#10000,3,17,3,17)
176+
hasLocation(#20051,#20052)
177+
#20053=*
178+
tokeninfo(#20053,0,#20001,13,"")
179+
#20054=@"loc,{#10000},4,1,4,0"
180+
locations_default(#20054,#10000,4,1,4,0)
181+
hasLocation(#20053,#20054)
182+
#20055=*
183+
entry_cfg_node(#20055,#20001)
184+
#20056=@"loc,{#10000},1,1,1,0"
185+
locations_default(#20056,#10000,1,1,1,0)
186+
hasLocation(#20055,#20056)
187+
#20057=*
188+
exit_cfg_node(#20057,#20001)
189+
hasLocation(#20057,#20054)
190+
successor(#20018,#20020)
191+
successor(#20020,#20024)
192+
successor(#20026,#20022)
193+
successor(#20024,#20026)
194+
successor(#20022,#20057)
195+
successor(#20005,#20011)
196+
successor(#20016,#20007)
197+
successor(#20014,#20009)
198+
successor(#20011,#20014)
199+
successor(#20009,#20016)
200+
successor(#20007,#20018)
201+
successor(#20055,#20005)
202+
numlines(#10000,3,2,0)
203+
filetype(#10000,"javascript")

0 commit comments

Comments
 (0)