mirror of
https://github.com/github/semantic.git
synced 2024-12-23 06:41:45 +03:00
5509 lines
398 KiB
JSON
5509 lines
398 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-nested-functions-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
103,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
103,
|
|
103
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"72531d81633b54539c4e0e118c94794023582163"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index e69de29..72531d8 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "790f317cf635d64f5798d63a5b58483fd6bad99f..583329489c6f6b0bffd28c0ba69c284b7f1b811b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-nested-functions-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
221
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
223,
|
|
227
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
246,
|
|
251
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
253,
|
|
257
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
259,
|
|
263
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
267,
|
|
274
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
275,
|
|
278
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
279,
|
|
283
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
284
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
285
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
286,
|
|
293
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
294,
|
|
297
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
298,
|
|
302
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
303
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
304
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
265,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
235,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
309
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
103,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
103
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
309,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
309,
|
|
309
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"72531d81633b54539c4e0e118c94794023582163",
|
|
"c960aae180e11fcaea00d3e8b5ff586e41e0f2da"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index 72531d8..c960aae 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }",
|
|
"+function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "583329489c6f6b0bffd28c0ba69c284b7f1b811b..5e0f442eda3b1d8f963cc7e248c5630420b5cff5"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-nested-functions-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
221
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
223,
|
|
227
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
246,
|
|
251
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
253,
|
|
257
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
259,
|
|
263
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
267,
|
|
274
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
275,
|
|
278
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
279,
|
|
283
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
284
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
285
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
286,
|
|
293
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
294,
|
|
297
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
298,
|
|
302
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
303
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
304
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
265,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
235,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
309
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
221
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
223,
|
|
227
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
246,
|
|
251
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
253,
|
|
257
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
259,
|
|
263
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
267,
|
|
274
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
275,
|
|
278
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
279,
|
|
283
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
284
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
285
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
286,
|
|
293
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
294,
|
|
297
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
298,
|
|
302
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
303
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
304
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
265,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
235,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
309
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
309,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
309,
|
|
309
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
309,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
309,
|
|
309
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"c960aae180e11fcaea00d3e8b5ff586e41e0f2da",
|
|
"1b9b61a3964ffb047472f21103b352f506252d1f"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index c960aae..1b9b61a 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }",
|
|
"+function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "5e0f442eda3b1d8f963cc7e248c5630420b5cff5..4ce43f40272580f43a9fb8e2b7cdaf164023371b"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-nested-functions-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
221
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
223,
|
|
227
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
246,
|
|
251
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
253,
|
|
257
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
259,
|
|
263
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
267,
|
|
274
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
275,
|
|
278
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
279,
|
|
283
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
284
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
285
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
286,
|
|
293
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
294,
|
|
297
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
298,
|
|
302
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
303
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
304
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
265,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
235,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
309
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
221
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
223,
|
|
227
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
246,
|
|
251
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
253,
|
|
257
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
259,
|
|
263
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
267,
|
|
274
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
275,
|
|
278
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
279,
|
|
283
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
284
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
285
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
286,
|
|
293
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
294,
|
|
297
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
298,
|
|
302
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
303
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
304
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
265,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
235,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
309
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
309,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
309,
|
|
309
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
309,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
309,
|
|
309
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"1b9b61a3964ffb047472f21103b352f506252d1f",
|
|
"c960aae180e11fcaea00d3e8b5ff586e41e0f2da"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index 1b9b61a..c960aae 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
"+function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "4ce43f40272580f43a9fb8e2b7cdaf164023371b..66f83c285b323ea127caf0550c0dc30e999711af"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-nested-functions-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
221
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
223,
|
|
227
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
246,
|
|
251
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
253,
|
|
257
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
259,
|
|
263
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
267,
|
|
274
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
275,
|
|
278
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
279,
|
|
283
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
284
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
267,
|
|
285
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
286,
|
|
293
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
294,
|
|
297
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
298,
|
|
302
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
303
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
286,
|
|
304
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
265,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
237,
|
|
306
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
235,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
308
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
206,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
309
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
309,
|
|
309
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
309,
|
|
309
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
206,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
206
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"c960aae180e11fcaea00d3e8b5ff586e41e0f2da",
|
|
"81522c7de2c57509747653614226409aac798ff8"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index c960aae..81522c7 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }",
|
|
"-function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
"+function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "66f83c285b323ea127caf0550c0dc30e999711af..f73fd1833e4219f46c9fbf2a4b40b819b299f142"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-nested-functions-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
118
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
130
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
143,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
150,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
156,
|
|
160
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
164,
|
|
171
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
172,
|
|
175
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
176,
|
|
180
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
181
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
164,
|
|
182
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
183,
|
|
190
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
199
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
200
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
183,
|
|
201
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
162,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
134,
|
|
203
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
132,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
205
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
206
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
206,
|
|
206
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
206,
|
|
206
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
103,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
103,
|
|
103
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"81522c7de2c57509747653614226409aac798ff8",
|
|
"3056480033bd7114a2ec5dd52e466f4f746952c1"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index 81522c7..3056480 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg3); console.log(arg4); } }",
|
|
" function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "f73fd1833e4219f46c9fbf2a4b40b819b299f142..eef7c0a54cfb951da941ad6f8697f41ee7eabc07"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-nested-functions-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
9,
|
|
15
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
17,
|
|
21
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
27
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "trailing_expression_statement",
|
|
"children": [
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
40,
|
|
45
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
51
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
53,
|
|
57
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
68
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
69,
|
|
72
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
79
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
87
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
88,
|
|
91
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
92,
|
|
96
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
97
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
80,
|
|
98
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
59,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
100
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
29,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
102
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
103
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
103,
|
|
103
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
103,
|
|
103
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"nested-functions.js",
|
|
"nested-functions.js"
|
|
],
|
|
"oids": [
|
|
"3056480033bd7114a2ec5dd52e466f4f746952c1",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"nested-functions.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/nested-functions.js b/nested-functions.js",
|
|
"index 3056480..e69de29 100644",
|
|
"--- a/nested-functions.js",
|
|
"+++ b/nested-functions.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-function parent (arg1, arg2) { function child (arg3, arg4) { console.log(arg1); console.log(arg2); } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "eef7c0a54cfb951da941ad6f8697f41ee7eabc07..1eaceb51f0254fd4621ddd6e017876ef398d5d8e"
|
|
}]
|