mirror of
https://github.com/github/semantic.git
synced 2024-12-27 08:54:14 +03:00
3303 lines
183 KiB
JSON
3303 lines
183 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-chained-callbacks-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
31,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
22,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
39
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
39,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
39,
|
|
39
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"ce9ee1ed9e861af97055f45e8bba4135e730cd5c"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index e69de29..ce9ee1e 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+this.map(function (a) { return a.b; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "20036c5dfbcbfda6adb2ac623f76a2d33319daff..8fe67e615790750c81a0d0cf671039fd04874196"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-chained-callbacks-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
22,
|
|
23
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
34,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
25,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
42
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
62
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
74
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
75,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
66,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
64,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
51,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
42,
|
|
81
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
31,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
22,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
39
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
81,
|
|
85
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
86,
|
|
89
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
100,
|
|
101
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
113
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
114,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
112,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
105,
|
|
116
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
90,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
119
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
120
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
39,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
39,
|
|
39
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
120,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
120,
|
|
120
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"ce9ee1ed9e861af97055f45e8bba4135e730cd5c",
|
|
"acba744a8426d46dd1ef2f760336b6be5329b75b"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index ce9ee1e..acba744 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+this.reduce(function (a) { return b.a; })",
|
|
"+this.map(function (a) { return a.b; })",
|
|
" this.map(function (a) { return a.b; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "8fe67e615790750c81a0d0cf671039fd04874196..2a557ecea000afb29ccc7a685858096c6eee76a3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-chained-callbacks-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
22,
|
|
23
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
34,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
25,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
42
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
31,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
33,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
22,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
39
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
62
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
74
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
75,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
66,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
64,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
51,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
81
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
39,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
44,
|
|
47
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
58,
|
|
59
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
70,
|
|
71
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
72,
|
|
73
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
70,
|
|
73
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
63,
|
|
74
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
48,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
39,
|
|
78
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
81,
|
|
85
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
86,
|
|
89
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
100,
|
|
101
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
113
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
114,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
112,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
105,
|
|
116
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
90,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
119
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
120
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
82
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
83,
|
|
86
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
97,
|
|
98
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
109,
|
|
110
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
111,
|
|
112
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
109,
|
|
112
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
102,
|
|
113
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
100,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
78,
|
|
116
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
78,
|
|
117
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
78,
|
|
117
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
78,
|
|
117
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
120,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
120,
|
|
120
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
117,
|
|
117
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
117,
|
|
117
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"acba744a8426d46dd1ef2f760336b6be5329b75b",
|
|
"7390534322bff352014e45fdc8399881b290d5a2"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index acba744..7390534 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-this.reduce(function (a) { return b.a; })",
|
|
"+this.map(function (a) { return a.b; })",
|
|
" this.map(function (a) { return a.b; })",
|
|
" this.map(function (a) { return a.b; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "2a557ecea000afb29ccc7a685858096c6eee76a3..11717a449f96cc2edba70e66ebe01b4f23cd9cc7"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-chained-callbacks-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
31,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
33,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
22,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
39
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
22,
|
|
23
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
34,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
25,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
42
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
39,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
44,
|
|
47
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
58,
|
|
59
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
70,
|
|
71
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
72,
|
|
73
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
70,
|
|
73
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
63,
|
|
74
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
61,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
48,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
78
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
39,
|
|
78
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
62
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
74
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
75,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
66,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
64,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
51,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
81
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
82
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
83,
|
|
86
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
97,
|
|
98
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
109,
|
|
110
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
111,
|
|
112
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
109,
|
|
112
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
102,
|
|
113
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
100,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
78,
|
|
116
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
78,
|
|
117
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
78,
|
|
117
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
78,
|
|
117
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
81,
|
|
85
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
86,
|
|
89
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
100,
|
|
101
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
113
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
114,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
112,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
105,
|
|
116
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
90,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
119
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
120
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
117,
|
|
117
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
117,
|
|
117
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
120,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
120,
|
|
120
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"7390534322bff352014e45fdc8399881b290d5a2",
|
|
"acba744a8426d46dd1ef2f760336b6be5329b75b"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index 7390534..acba744 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-this.map(function (a) { return a.b; })",
|
|
"+this.reduce(function (a) { return b.a; })",
|
|
" this.map(function (a) { return a.b; })",
|
|
" this.map(function (a) { return a.b; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "11717a449f96cc2edba70e66ebe01b4f23cd9cc7..0cac26668c9121a11276917ab985c409a8091507"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-chained-callbacks-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
22,
|
|
23
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
34,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
25,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
42
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
42,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
47,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
62
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
74
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
75,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
66,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
64,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
51,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
42,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
42,
|
|
81
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
81,
|
|
85
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
86,
|
|
89
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
100,
|
|
101
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
112,
|
|
113
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
114,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
112,
|
|
115
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
105,
|
|
116
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
103,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
90,
|
|
118
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
119
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
81,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
120
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
31,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
22,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
39
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
39,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
44,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
62
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
74
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
75,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
66,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
64,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
51,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
39,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
39,
|
|
81
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
120,
|
|
120
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
120,
|
|
120
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
81,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
81
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"acba744a8426d46dd1ef2f760336b6be5329b75b",
|
|
"c4db4326d7f3f7ffe3d6ec61d9962c153c2d3d9e"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index acba744..c4db432 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-this.reduce(function (a) { return b.a; })",
|
|
"-this.map(function (a) { return a.b; })",
|
|
" this.map(function (a) { return a.b; })",
|
|
"+this.reduce(function (a) { return b.a; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "0cac26668c9121a11276917ab985c409a8091507..f00a27acc2ab003cdeb75993917c80427380f75a"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-chained-callbacks-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
8
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
20
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
31,
|
|
32
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
33,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
31,
|
|
34
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
24,
|
|
35
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
22,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
9,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
39
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
39
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
39,
|
|
43
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
44,
|
|
50
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
61,
|
|
62
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
73,
|
|
74
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
75,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
76
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
66,
|
|
77
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
64,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
51,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
39,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
39,
|
|
81
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
22,
|
|
23
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
34,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
25,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
42
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
81,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
81,
|
|
81
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
42,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
42,
|
|
42
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"c4db4326d7f3f7ffe3d6ec61d9962c153c2d3d9e",
|
|
"e593419889a5ac26f2f6d01ba83fe3c421f04feb"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index c4db432..e593419 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-this.map(function (a) { return a.b; })",
|
|
" this.reduce(function (a) { return b.a; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "f00a27acc2ab003cdeb75993917c80427380f75a..ee5b62d892c81a79ad65ad30e017ee7f983b46fb"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-chained-callbacks-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "MethodCall",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
0,
|
|
4
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
5,
|
|
11
|
|
]
|
|
},
|
|
{
|
|
"category": "Function",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
22,
|
|
23
|
|
]
|
|
},
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "MemberAccess",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
34,
|
|
35
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
36,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
34,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
27,
|
|
38
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
25,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
12,
|
|
40
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
41
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
42
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
42,
|
|
42
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
42,
|
|
42
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"chained-callbacks.js",
|
|
"chained-callbacks.js"
|
|
],
|
|
"oids": [
|
|
"e593419889a5ac26f2f6d01ba83fe3c421f04feb",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"chained-callbacks.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/chained-callbacks.js b/chained-callbacks.js",
|
|
"index e593419..e69de29 100644",
|
|
"--- a/chained-callbacks.js",
|
|
"+++ b/chained-callbacks.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-this.reduce(function (a) { return b.a; })"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "ee5b62d892c81a79ad65ad30e017ee7f983b46fb..2f1a5ed4016f7e817cb5b1b4839bb64deecd8042"
|
|
}]
|