-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathexpected-edges.json
More file actions
301 lines (301 loc) · 12.1 KB
/
Copy pathexpected-edges.json
File metadata and controls
301 lines (301 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
{
"$schema": "../../expected-edges.schema.json",
"language": "javascript",
"description": "Hand-annotated call edges for JavaScript resolution benchmark",
"edges": [
{
"source": { "name": "UserService.createUser", "file": "service.js" },
"target": { "name": "normalize", "file": "validators.js" },
"kind": "calls",
"mode": "static",
"notes": "Direct imported function call from method"
},
{
"source": { "name": "UserService.createUser", "file": "service.js" },
"target": { "name": "validate", "file": "validators.js" },
"kind": "calls",
"mode": "static",
"notes": "Direct imported function call from method"
},
{
"source": { "name": "UserService.createUser", "file": "service.js" },
"target": { "name": "Logger.error", "file": "logger.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "this.logger.error() — receiver-typed via constructor assignment"
},
{
"source": { "name": "UserService.createUser", "file": "service.js" },
"target": { "name": "Logger.info", "file": "logger.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "this.logger.info() — receiver-typed via constructor assignment"
},
{
"source": { "name": "UserService.deleteUser", "file": "service.js" },
"target": { "name": "Logger.warn", "file": "logger.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "this.logger.warn() — receiver-typed via constructor assignment"
},
{
"source": { "name": "Logger.info", "file": "logger.js" },
"target": { "name": "Logger._write", "file": "logger.js" },
"kind": "calls",
"mode": "same-file",
"notes": "this._write() — same-class method call"
},
{
"source": { "name": "Logger.warn", "file": "logger.js" },
"target": { "name": "Logger._write", "file": "logger.js" },
"kind": "calls",
"mode": "same-file",
"notes": "this._write() — same-class method call"
},
{
"source": { "name": "Logger.error", "file": "logger.js" },
"target": { "name": "Logger._write", "file": "logger.js" },
"kind": "calls",
"mode": "same-file",
"notes": "this._write() — same-class method call"
},
{
"source": { "name": "validate", "file": "validators.js" },
"target": { "name": "checkLength", "file": "validators.js" },
"kind": "calls",
"mode": "same-file",
"notes": "Same-file function call"
},
{
"source": { "name": "normalize", "file": "validators.js" },
"target": { "name": "trimWhitespace", "file": "validators.js" },
"kind": "calls",
"mode": "same-file",
"notes": "Same-file function call"
},
{
"source": { "name": "main", "file": "index.js" },
"target": { "name": "buildService", "file": "service.js" },
"kind": "calls",
"mode": "static",
"notes": "Direct imported function call"
},
{
"source": { "name": "main", "file": "index.js" },
"target": { "name": "UserService.createUser", "file": "service.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "svc.createUser() — receiver typed via buildService() return"
},
{
"source": { "name": "main", "file": "index.js" },
"target": { "name": "validate", "file": "validators.js" },
"kind": "calls",
"mode": "static",
"notes": "Direct imported function call"
},
{
"source": { "name": "main", "file": "index.js" },
"target": { "name": "UserService.deleteUser", "file": "service.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "svc.deleteUser() — receiver typed via buildService() return"
},
{
"source": { "name": "directInstantiation", "file": "index.js" },
"target": { "name": "UserService.createUser", "file": "service.js" },
"kind": "calls",
"mode": "constructor",
"notes": "svc.createUser() — receiver typed via new UserService()"
},
{
"source": { "name": "directInstantiation", "file": "index.js" },
"target": { "name": "UserService", "file": "service.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new UserService() — class instantiation tracked as consumption"
},
{
"source": { "name": "UserService.constructor", "file": "service.js" },
"target": { "name": "Logger", "file": "logger.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new Logger('UserService') — class instantiation in constructor"
},
{
"source": { "name": "buildService", "file": "service.js" },
"target": { "name": "UserService", "file": "service.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new UserService() — class instantiation tracked as consumption"
},
{
"source": { "name": "_defProp", "file": "define-property.js" },
"target": { "name": "f1", "file": "define-property.js" },
"kind": "calls",
"mode": "pts-define-property",
"notes": "obj.f() — resolved via Object.defineProperty(obj, \"f\", { value: f1 })"
},
{
"source": { "name": "_defProps", "file": "define-property.js" },
"target": { "name": "f1", "file": "define-property.js" },
"kind": "calls",
"mode": "pts-define-property",
"notes": "obj.f1() — resolved via Object.defineProperties(obj, { \"f1\": { value: f1 } })"
},
{
"source": { "name": "_defProps", "file": "define-property.js" },
"target": { "name": "f2", "file": "define-property.js" },
"kind": "calls",
"mode": "pts-define-property",
"notes": "obj.f2() — resolved via Object.defineProperties(obj, { \"f2\": { value: f2 } })"
},
{
"source": { "name": "_create", "file": "define-property.js" },
"target": { "name": "f1", "file": "define-property.js" },
"kind": "calls",
"mode": "pts-create-prototype",
"notes": "obj.f1() — resolved via Object.create({ f1, f2 })"
},
{
"source": { "name": "_create", "file": "define-property.js" },
"target": { "name": "f2", "file": "define-property.js" },
"kind": "calls",
"mode": "pts-create-prototype",
"notes": "obj.f2() — resolved via Object.create({ f1, f2 })"
},
{
"source": { "name": "getter", "file": "define-property.js" },
"target": { "name": "baz", "file": "define-property.js" },
"kind": "calls",
"mode": "define-property",
"notes": "this.baz() inside getter — this === accessorTarget (registered via Object.defineProperty)"
},
{
"source": { "name": "runBind", "file": "bind-call-apply.js" },
"target": { "name": "greet", "file": "bind-call-apply.js" },
"kind": "calls",
"mode": "points-to",
"notes": "greetUser() — greetUser = greet.bind(user), pts tracks greetUser → greet"
},
{
"source": { "name": "runCall", "file": "bind-call-apply.js" },
"target": { "name": "greet", "file": "bind-call-apply.js" },
"kind": "calls",
"mode": "dynamic",
"notes": "greet.call(user, 'Hi') — .call() extracts greet as the callee"
},
{
"source": { "name": "runApply", "file": "bind-call-apply.js" },
"target": { "name": "greet", "file": "bind-call-apply.js" },
"kind": "calls",
"mode": "dynamic",
"notes": "greet.apply(user, ['Hey']) — .apply() extracts greet as the callee"
},
{
"source": { "name": "runCallThis", "file": "bind-call-apply.js" },
"target": { "name": "invoker", "file": "bind-call-apply.js" },
"kind": "calls",
"mode": "dynamic",
"notes": "invoker.call(handler, 10) — .call() extracts invoker as the callee"
},
{
"source": { "name": "invoker", "file": "bind-call-apply.js" },
"target": { "name": "handler", "file": "bind-call-apply.js" },
"kind": "calls",
"mode": "points-to",
"notes": "invoker.call(handler, 10) — this-rebinding: this() inside invoker resolves to handler"
},
{
"source": { "name": "Dog.speak", "file": "inheritance.js" },
"target": { "name": "Animal.speak", "file": "inheritance.js" },
"kind": "calls",
"mode": "class-inheritance",
"notes": "super.speak() in Dog.speak resolves to Animal.speak via CHA parents map"
},
{
"source": { "name": "Puppy.speak", "file": "inheritance.js" },
"target": { "name": "Dog.speak", "file": "inheritance.js" },
"kind": "calls",
"mode": "class-inheritance",
"notes": "super.speak() in Puppy.speak resolves to Dog.speak (nearest parent), not Animal.speak"
},
{
"source": { "name": "DoubleCounter.count", "file": "inheritance.js" },
"target": { "name": "Counter.count", "file": "inheritance.js" },
"kind": "calls",
"mode": "class-inheritance",
"notes": "static super.count() in DoubleCounter.count resolves to Counter.count via CHA parents map"
},
{
"source": { "name": "runPrototypes", "file": "prototypes.js" },
"target": { "name": "C", "file": "prototypes.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new C() — constructor call to function-based constructor"
},
{
"source": { "name": "runPrototypes", "file": "prototypes.js" },
"target": { "name": "C.foo", "file": "prototypes.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "v.foo() — v typed as C via new C(), C.foo defined via C.prototype = { foo: fn }"
},
{
"source": { "name": "testPrototypeAlias", "file": "prototypes2.js" },
"target": { "name": "A", "file": "prototypes2.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new A() — inline constructor call in new A().t()"
},
{
"source": { "name": "testPrototypeAlias", "file": "prototypes2.js" },
"target": { "name": "f", "file": "prototypes2.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "new A().t() — A.prototype.t = f alias; inline new receiver resolved to type A, typeMap['A.t'] = f"
},
{
"source": { "name": "accessorGetter", "file": "define-property-accessor.js" },
"target": { "name": "accessorTarget.accessMethod", "file": "define-property-accessor.js" },
"kind": "calls",
"mode": "defineProperty-accessor",
"notes": "this.accessMethod() inside accessorGetter — this === accessorTarget (get accessor via Object.defineProperty); accessorTarget.accessMethod is the qualified node name for the arrow function property of accessorTarget"
},
{
"source": { "name": "ClassA.constructor", "file": "multi-class.js" },
"target": { "name": "ServiceA", "file": "multi-class.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new ServiceA() — constructor call in ClassA.constructor"
},
{
"source": { "name": "ClassB.constructor", "file": "multi-class.js" },
"target": { "name": "ServiceB", "file": "multi-class.js" },
"kind": "calls",
"mode": "constructor",
"notes": "new ServiceB() — constructor call in ClassB.constructor"
},
{
"source": { "name": "ClassA.runA", "file": "multi-class.js" },
"target": { "name": "ServiceA.doA", "file": "multi-class.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "this.service.doA() — receiver-typed via ClassA.service = new ServiceA() (class-scoped typeMap key prevents collision with ClassB.service)"
},
{
"source": { "name": "ClassB.runB", "file": "multi-class.js" },
"target": { "name": "ServiceB.doB", "file": "multi-class.js" },
"kind": "calls",
"mode": "receiver-typed",
"notes": "this.service.doB() — receiver-typed via ClassB.service = new ServiceB() (class-scoped typeMap key prevents collision with ClassA.service)"
},
{
"source": { "name": "Processor.run", "file": "class-scope.js" },
"target": { "name": "processData", "file": "class-scope.js" },
"kind": "calls",
"mode": "same-file",
"notes": "Bare call to same-file module-level function — regression guard: bare flush() in run() must NOT resolve to Processor.flush (class-scoped lookup must be receiver-gated)"
}
]
}