mirror of
https://github.com/github/semantic.git
synced 2024-11-24 00:42:33 +03:00
Migrate javascript test cases over
This commit is contained in:
parent
b80667f5b4
commit
6e9a2d24d9
@ -23,7 +23,9 @@ spec :: Spec
|
||||
spec = parallel $ do
|
||||
it "lists example fixtures" $ do
|
||||
examples "test/fixtures/ruby/" `shouldNotReturn` []
|
||||
examples "test/fixtures/javascript/" `shouldNotReturn` []
|
||||
|
||||
describe "javascript" $ runTestsIn "test/fixtures/javascript/"
|
||||
describe "ruby" $ runTestsIn "test/fixtures/ruby/"
|
||||
|
||||
where
|
||||
|
1
test/fixtures/javascript/anonymous-function.A.js
vendored
Normal file
1
test/fixtures/javascript/anonymous-function.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
function(a,b) { return a + b; }
|
1
test/fixtures/javascript/anonymous-function.B.js
vendored
Normal file
1
test/fixtures/javascript/anonymous-function.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
function(b,c) { return b * c; }
|
17
test/fixtures/javascript/anonymous-function.diffA-B.txt
vendored
Normal file
17
test/fixtures/javascript/anonymous-function.diffA-B.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
{ (MathOperator
|
||||
(Identifier)
|
||||
(Other "+")
|
||||
(Identifier))
|
||||
->(MathOperator
|
||||
(Identifier)
|
||||
(Other "*")
|
||||
(Identifier)) })))))
|
17
test/fixtures/javascript/anonymous-function.diffB-A.txt
vendored
Normal file
17
test/fixtures/javascript/anonymous-function.diffB-A.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
{ (MathOperator
|
||||
(Identifier)
|
||||
(Other "*")
|
||||
(Identifier))
|
||||
->(MathOperator
|
||||
(Identifier)
|
||||
(Other "+")
|
||||
(Identifier)) })))))
|
11
test/fixtures/javascript/anonymous-function.parseA.txt
vendored
Normal file
11
test/fixtures/javascript/anonymous-function.parseA.txt
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "+")
|
||||
(Identifier)))))))
|
11
test/fixtures/javascript/anonymous-function.parseB.txt
vendored
Normal file
11
test/fixtures/javascript/anonymous-function.parseB.txt
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "*")
|
||||
(Identifier)))))))
|
1
test/fixtures/javascript/anonymous-parameterless-function.A.js
vendored
Normal file
1
test/fixtures/javascript/anonymous-parameterless-function.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
function() { return 'hi'; }
|
1
test/fixtures/javascript/anonymous-parameterless-function.B.js
vendored
Normal file
1
test/fixtures/javascript/anonymous-parameterless-function.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
function() { return 'hello'; }
|
7
test/fixtures/javascript/anonymous-parameterless-function.diffA-B.txt
vendored
Normal file
7
test/fixtures/javascript/anonymous-parameterless-function.diffA-B.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
{ (StringLiteral)
|
||||
->(StringLiteral) })))))
|
7
test/fixtures/javascript/anonymous-parameterless-function.diffB-A.txt
vendored
Normal file
7
test/fixtures/javascript/anonymous-parameterless-function.diffB-A.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
{ (StringLiteral)
|
||||
->(StringLiteral) })))))
|
6
test/fixtures/javascript/anonymous-parameterless-function.parseA.txt
vendored
Normal file
6
test/fixtures/javascript/anonymous-parameterless-function.parseA.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(StringLiteral))))))
|
6
test/fixtures/javascript/anonymous-parameterless-function.parseB.txt
vendored
Normal file
6
test/fixtures/javascript/anonymous-parameterless-function.parseB.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(StringLiteral))))))
|
1
test/fixtures/javascript/array.A.js
vendored
Normal file
1
test/fixtures/javascript/array.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
[ "item1" ];
|
1
test/fixtures/javascript/array.B.js
vendored
Normal file
1
test/fixtures/javascript/array.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
[ "item1", "item2" ];
|
5
test/fixtures/javascript/array.diffA-B.txt
vendored
Normal file
5
test/fixtures/javascript/array.diffA-B.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(ArrayLiteral
|
||||
(StringLiteral)
|
||||
{+(StringLiteral)+})))
|
5
test/fixtures/javascript/array.diffB-A.txt
vendored
Normal file
5
test/fixtures/javascript/array.diffB-A.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(ArrayLiteral
|
||||
(StringLiteral)
|
||||
{-(StringLiteral)-})))
|
4
test/fixtures/javascript/array.parseA.txt
vendored
Normal file
4
test/fixtures/javascript/array.parseA.txt
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(ArrayLiteral
|
||||
(StringLiteral))))
|
5
test/fixtures/javascript/array.parseB.txt
vendored
Normal file
5
test/fixtures/javascript/array.parseB.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(ArrayLiteral
|
||||
(StringLiteral)
|
||||
(StringLiteral))))
|
1
test/fixtures/javascript/arrow-function.A.js
vendored
Normal file
1
test/fixtures/javascript/arrow-function.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(f, g) => { return h; };
|
1
test/fixtures/javascript/arrow-function.B.js
vendored
Normal file
1
test/fixtures/javascript/arrow-function.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(f, g) => { return g; };
|
9
test/fixtures/javascript/arrow-function.diffA-B.txt
vendored
Normal file
9
test/fixtures/javascript/arrow-function.diffA-B.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
9
test/fixtures/javascript/arrow-function.diffB-A.txt
vendored
Normal file
9
test/fixtures/javascript/arrow-function.diffB-A.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))
|
8
test/fixtures/javascript/arrow-function.parseA.txt
vendored
Normal file
8
test/fixtures/javascript/arrow-function.parseA.txt
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(Identifier))))))
|
8
test/fixtures/javascript/arrow-function.parseB.txt
vendored
Normal file
8
test/fixtures/javascript/arrow-function.parseB.txt
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Function
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(Identifier))))))
|
1
test/fixtures/javascript/assignment.A.js
vendored
Normal file
1
test/fixtures/javascript/assignment.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
x = 0;
|
1
test/fixtures/javascript/assignment.B.js
vendored
Normal file
1
test/fixtures/javascript/assignment.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
x = 1;
|
6
test/fixtures/javascript/assignment.diffA-B.txt
vendored
Normal file
6
test/fixtures/javascript/assignment.diffA-B.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Assignment
|
||||
(Identifier)
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })))
|
6
test/fixtures/javascript/assignment.diffB-A.txt
vendored
Normal file
6
test/fixtures/javascript/assignment.diffB-A.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Assignment
|
||||
(Identifier)
|
||||
{ (NumberLiteral)
|
||||
->(NumberLiteral) })))
|
5
test/fixtures/javascript/assignment.parseA.txt
vendored
Normal file
5
test/fixtures/javascript/assignment.parseA.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))))
|
5
test/fixtures/javascript/assignment.parseB.txt
vendored
Normal file
5
test/fixtures/javascript/assignment.parseB.txt
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))))
|
1
test/fixtures/javascript/bitwise-operator.A.js
vendored
Normal file
1
test/fixtures/javascript/bitwise-operator.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
i >> j;
|
1
test/fixtures/javascript/bitwise-operator.B.js
vendored
Normal file
1
test/fixtures/javascript/bitwise-operator.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
i >> k;
|
7
test/fixtures/javascript/bitwise-operator.diffA-B.txt
vendored
Normal file
7
test/fixtures/javascript/bitwise-operator.diffA-B.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(BitwiseOperator
|
||||
(Identifier)
|
||||
(Other ">>")
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
7
test/fixtures/javascript/bitwise-operator.diffB-A.txt
vendored
Normal file
7
test/fixtures/javascript/bitwise-operator.diffB-A.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(BitwiseOperator
|
||||
(Identifier)
|
||||
(Other ">>")
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
6
test/fixtures/javascript/bitwise-operator.parseA.txt
vendored
Normal file
6
test/fixtures/javascript/bitwise-operator.parseA.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(BitwiseOperator
|
||||
(Identifier)
|
||||
(Other ">>")
|
||||
(Identifier))))
|
6
test/fixtures/javascript/bitwise-operator.parseB.txt
vendored
Normal file
6
test/fixtures/javascript/bitwise-operator.parseB.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(BitwiseOperator
|
||||
(Identifier)
|
||||
(Other ">>")
|
||||
(Identifier))))
|
1
test/fixtures/javascript/boolean-operator.A.js
vendored
Normal file
1
test/fixtures/javascript/boolean-operator.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
i || j;
|
1
test/fixtures/javascript/boolean-operator.B.js
vendored
Normal file
1
test/fixtures/javascript/boolean-operator.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
i && j;
|
10
test/fixtures/javascript/boolean-operator.diffA-B.txt
vendored
Normal file
10
test/fixtures/javascript/boolean-operator.diffA-B.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
{ (BooleanOperator
|
||||
(Identifier)
|
||||
(Other "||")
|
||||
(Identifier))
|
||||
->(BooleanOperator
|
||||
(Identifier)
|
||||
(Other "&&")
|
||||
(Identifier)) }))
|
10
test/fixtures/javascript/boolean-operator.diffB-A.txt
vendored
Normal file
10
test/fixtures/javascript/boolean-operator.diffB-A.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
{ (BooleanOperator
|
||||
(Identifier)
|
||||
(Other "&&")
|
||||
(Identifier))
|
||||
->(BooleanOperator
|
||||
(Identifier)
|
||||
(Other "||")
|
||||
(Identifier)) }))
|
6
test/fixtures/javascript/boolean-operator.parseA.txt
vendored
Normal file
6
test/fixtures/javascript/boolean-operator.parseA.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(BooleanOperator
|
||||
(Identifier)
|
||||
(Other "||")
|
||||
(Identifier))))
|
6
test/fixtures/javascript/boolean-operator.parseB.txt
vendored
Normal file
6
test/fixtures/javascript/boolean-operator.parseB.txt
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(BooleanOperator
|
||||
(Identifier)
|
||||
(Other "&&")
|
||||
(Identifier))))
|
1
test/fixtures/javascript/break.A.js
vendored
Normal file
1
test/fixtures/javascript/break.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
for (i = 0; i < 10; i++) { if (i === 4) { break; }; i }
|
1
test/fixtures/javascript/break.B.js
vendored
Normal file
1
test/fixtures/javascript/break.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
for (i = 0; i < 10; i++) { if (i === 4) { continue; }; i }
|
23
test/fixtures/javascript/break.diffA-B.txt
vendored
Normal file
23
test/fixtures/javascript/break.diffA-B.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
{+(Continue)+}
|
||||
{-(Break)-}))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
23
test/fixtures/javascript/break.diffB-A.txt
vendored
Normal file
23
test/fixtures/javascript/break.diffB-A.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
{+(Break)+}
|
||||
{-(Continue)-}))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
22
test/fixtures/javascript/break.parseA.txt
vendored
Normal file
22
test/fixtures/javascript/break.parseA.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
(Break)))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
22
test/fixtures/javascript/break.parseB.txt
vendored
Normal file
22
test/fixtures/javascript/break.parseB.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
(Continue)))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
1
test/fixtures/javascript/chained-callbacks.A.js
vendored
Normal file
1
test/fixtures/javascript/chained-callbacks.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
this.map(function (a) { return a.b; })
|
1
test/fixtures/javascript/chained-callbacks.B.js
vendored
Normal file
1
test/fixtures/javascript/chained-callbacks.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
this.reduce(function (a) { return b.a; })
|
15
test/fixtures/javascript/chained-callbacks.diffA-B.txt
vendored
Normal file
15
test/fixtures/javascript/chained-callbacks.diffA-B.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(MemberAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))))
|
15
test/fixtures/javascript/chained-callbacks.diffB-A.txt
vendored
Normal file
15
test/fixtures/javascript/chained-callbacks.diffB-A.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(MemberAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
{ (Identifier)
|
||||
->(Identifier) })))))))
|
12
test/fixtures/javascript/chained-callbacks.parseA.txt
vendored
Normal file
12
test/fixtures/javascript/chained-callbacks.parseA.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))))))))
|
12
test/fixtures/javascript/chained-callbacks.parseB.txt
vendored
Normal file
12
test/fixtures/javascript/chained-callbacks.parseB.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Function
|
||||
(Identifier)
|
||||
(ExpressionStatements
|
||||
(Return
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))))))))
|
1
test/fixtures/javascript/chained-property-access.A.js
vendored
Normal file
1
test/fixtures/javascript/chained-property-access.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
return returned.promise().done( newDefer.resolve ).fail( newDefer.reject )
|
1
test/fixtures/javascript/chained-property-access.B.js
vendored
Normal file
1
test/fixtures/javascript/chained-property-access.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
return returned.promise().done( otherDefer.resolve ).fail( otherDefer.reject )
|
17
test/fixtures/javascript/chained-property-access.diffA-B.txt
vendored
Normal file
17
test/fixtures/javascript/chained-property-access.diffA-B.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Return
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)))))
|
17
test/fixtures/javascript/chained-property-access.diffB-A.txt
vendored
Normal file
17
test/fixtures/javascript/chained-property-access.diffB-A.txt
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
(Program
|
||||
(Return
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)))))
|
15
test/fixtures/javascript/chained-property-access.parseA.txt
vendored
Normal file
15
test/fixtures/javascript/chained-property-access.parseA.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(Program
|
||||
(Return
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))))
|
15
test/fixtures/javascript/chained-property-access.parseB.txt
vendored
Normal file
15
test/fixtures/javascript/chained-property-access.parseB.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
(Program
|
||||
(Return
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
(Identifier)
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))))
|
1
test/fixtures/javascript/class.A.js
vendored
Normal file
1
test/fixtures/javascript/class.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }
|
1
test/fixtures/javascript/class.B.js
vendored
Normal file
1
test/fixtures/javascript/class.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }
|
22
test/fixtures/javascript/class.diffA-B.txt
vendored
Normal file
22
test/fixtures/javascript/class.diffA-B.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Class
|
||||
(Identifier)
|
||||
(Method
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier))))))
|
22
test/fixtures/javascript/class.diffB-A.txt
vendored
Normal file
22
test/fixtures/javascript/class.diffB-A.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Class
|
||||
(Identifier)
|
||||
(Method
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
{ (Identifier)
|
||||
->(Identifier) }
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier))))))
|
19
test/fixtures/javascript/class.parseA.txt
vendored
Normal file
19
test/fixtures/javascript/class.parseA.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Class
|
||||
(Identifier)
|
||||
(Method
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier))))))
|
19
test/fixtures/javascript/class.parseB.txt
vendored
Normal file
19
test/fixtures/javascript/class.parseB.txt
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Class
|
||||
(Identifier)
|
||||
(Method
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier)))
|
||||
(Method
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(Return
|
||||
(Identifier))))))
|
1
test/fixtures/javascript/comma-operator.A.js
vendored
Normal file
1
test/fixtures/javascript/comma-operator.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
a = 1, b = 2;
|
1
test/fixtures/javascript/comma-operator.B.js
vendored
Normal file
1
test/fixtures/javascript/comma-operator.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
c = {d: (3, 4 + 5, 6)};
|
21
test/fixtures/javascript/comma-operator.diffA-B.txt
vendored
Normal file
21
test/fixtures/javascript/comma-operator.diffA-B.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
{+(Assignment
|
||||
(Identifier)
|
||||
(Object
|
||||
(Pair
|
||||
(Identifier)
|
||||
(CommaOperator
|
||||
(NumberLiteral)
|
||||
(MathOperator
|
||||
(NumberLiteral)
|
||||
(Other "+")
|
||||
(NumberLiteral))
|
||||
(NumberLiteral)))))+}
|
||||
{-(CommaOperator
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral)))-}))
|
21
test/fixtures/javascript/comma-operator.diffB-A.txt
vendored
Normal file
21
test/fixtures/javascript/comma-operator.diffB-A.txt
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
{+(CommaOperator
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral)))+}
|
||||
{-(Assignment
|
||||
(Identifier)
|
||||
(Object
|
||||
(Pair
|
||||
(Identifier)
|
||||
(CommaOperator
|
||||
(NumberLiteral)
|
||||
(MathOperator
|
||||
(NumberLiteral)
|
||||
(Other "+")
|
||||
(NumberLiteral))
|
||||
(NumberLiteral)))))-}))
|
9
test/fixtures/javascript/comma-operator.parseA.txt
vendored
Normal file
9
test/fixtures/javascript/comma-operator.parseA.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(CommaOperator
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral)))))
|
14
test/fixtures/javascript/comma-operator.parseB.txt
vendored
Normal file
14
test/fixtures/javascript/comma-operator.parseB.txt
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(Object
|
||||
(Pair
|
||||
(Identifier)
|
||||
(CommaOperator
|
||||
(NumberLiteral)
|
||||
(MathOperator
|
||||
(NumberLiteral)
|
||||
(Other "+")
|
||||
(NumberLiteral))
|
||||
(NumberLiteral)))))))
|
1
test/fixtures/javascript/comment.A.js
vendored
Normal file
1
test/fixtures/javascript/comment.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
// This is a property
|
3
test/fixtures/javascript/comment.B.js
vendored
Normal file
3
test/fixtures/javascript/comment.B.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
/*
|
||||
* This is a method
|
||||
*/
|
3
test/fixtures/javascript/comment.diffA-B.txt
vendored
Normal file
3
test/fixtures/javascript/comment.diffA-B.txt
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
(Program
|
||||
{ (Comment)
|
||||
->(Comment) })
|
3
test/fixtures/javascript/comment.diffB-A.txt
vendored
Normal file
3
test/fixtures/javascript/comment.diffB-A.txt
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
(Program
|
||||
{ (Comment)
|
||||
->(Comment) })
|
2
test/fixtures/javascript/comment.parseA.txt
vendored
Normal file
2
test/fixtures/javascript/comment.parseA.txt
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
(Program
|
||||
(Comment))
|
2
test/fixtures/javascript/comment.parseB.txt
vendored
Normal file
2
test/fixtures/javascript/comment.parseB.txt
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
(Program
|
||||
(Comment))
|
1
test/fixtures/javascript/constructor-call.A.js
vendored
Normal file
1
test/fixtures/javascript/constructor-call.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
new module.Klass(1, "two");
|
1
test/fixtures/javascript/constructor-call.B.js
vendored
Normal file
1
test/fixtures/javascript/constructor-call.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
new module.Klass(1, "three");
|
9
test/fixtures/javascript/constructor-call.diffA-B.txt
vendored
Normal file
9
test/fixtures/javascript/constructor-call.diffA-B.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Constructor
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(NumberLiteral)
|
||||
{ (StringLiteral)
|
||||
->(StringLiteral) }))))
|
9
test/fixtures/javascript/constructor-call.diffB-A.txt
vendored
Normal file
9
test/fixtures/javascript/constructor-call.diffB-A.txt
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Constructor
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(NumberLiteral)
|
||||
{ (StringLiteral)
|
||||
->(StringLiteral) }))))
|
8
test/fixtures/javascript/constructor-call.parseA.txt
vendored
Normal file
8
test/fixtures/javascript/constructor-call.parseA.txt
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Constructor
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(NumberLiteral)
|
||||
(StringLiteral)))))
|
8
test/fixtures/javascript/constructor-call.parseB.txt
vendored
Normal file
8
test/fixtures/javascript/constructor-call.parseB.txt
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Constructor
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
(NumberLiteral)
|
||||
(StringLiteral)))))
|
1
test/fixtures/javascript/continue.A.js
vendored
Normal file
1
test/fixtures/javascript/continue.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
for (i = 0; i < 10; i++) { if (i === 4) { continue; }; i }
|
1
test/fixtures/javascript/continue.B.js
vendored
Normal file
1
test/fixtures/javascript/continue.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
for (i = 0; i < 10; i++) { if (i === 4) { break; }; i }
|
23
test/fixtures/javascript/continue.diffA-B.txt
vendored
Normal file
23
test/fixtures/javascript/continue.diffA-B.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
{+(Break)+}
|
||||
{-(Continue)-}))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
23
test/fixtures/javascript/continue.diffB-A.txt
vendored
Normal file
23
test/fixtures/javascript/continue.diffB-A.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
{+(Continue)+}
|
||||
{-(Break)-}))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
22
test/fixtures/javascript/continue.parseA.txt
vendored
Normal file
22
test/fixtures/javascript/continue.parseA.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
(Continue)))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
22
test/fixtures/javascript/continue.parseB.txt
vendored
Normal file
22
test/fixtures/javascript/continue.parseB.txt
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(Program
|
||||
(For
|
||||
(Assignment
|
||||
(Identifier)
|
||||
(NumberLiteral))
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "<")
|
||||
(NumberLiteral))
|
||||
(MathOperator
|
||||
(Identifier)
|
||||
(Other "++"))
|
||||
(ExpressionStatements
|
||||
(If
|
||||
(RelationalOperator
|
||||
(Identifier)
|
||||
(Other "===")
|
||||
(NumberLiteral))
|
||||
(ExpressionStatements
|
||||
(Break)))
|
||||
(ExpressionStatements
|
||||
(Identifier)))))
|
1
test/fixtures/javascript/delete-operator.A.js
vendored
Normal file
1
test/fixtures/javascript/delete-operator.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
delete thing['prop'];
|
1
test/fixtures/javascript/delete-operator.B.js
vendored
Normal file
1
test/fixtures/javascript/delete-operator.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
delete thing.prop
|
12
test/fixtures/javascript/delete-operator.diffA-B.txt
vendored
Normal file
12
test/fixtures/javascript/delete-operator.diffA-B.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
{ (Operator
|
||||
(Other "delete")
|
||||
(SubscriptAccess
|
||||
(Identifier)
|
||||
(StringLiteral)))
|
||||
->(Operator
|
||||
(Other "delete")
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier))) }))
|
12
test/fixtures/javascript/delete-operator.diffB-A.txt
vendored
Normal file
12
test/fixtures/javascript/delete-operator.diffB-A.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
{ (Operator
|
||||
(Other "delete")
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))
|
||||
->(Operator
|
||||
(Other "delete")
|
||||
(SubscriptAccess
|
||||
(Identifier)
|
||||
(StringLiteral))) }))
|
7
test/fixtures/javascript/delete-operator.parseA.txt
vendored
Normal file
7
test/fixtures/javascript/delete-operator.parseA.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Operator
|
||||
(Other "delete")
|
||||
(SubscriptAccess
|
||||
(Identifier)
|
||||
(StringLiteral)))))
|
7
test/fixtures/javascript/delete-operator.parseB.txt
vendored
Normal file
7
test/fixtures/javascript/delete-operator.parseB.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
(Program
|
||||
(ExpressionStatements
|
||||
(Operator
|
||||
(Other "delete")
|
||||
(MemberAccess
|
||||
(Identifier)
|
||||
(Identifier)))))
|
1
test/fixtures/javascript/do-while-statement.A.js
vendored
Normal file
1
test/fixtures/javascript/do-while-statement.A.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
do { console.log(insert); } while (true);
|
1
test/fixtures/javascript/do-while-statement.B.js
vendored
Normal file
1
test/fixtures/javascript/do-while-statement.B.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
do { console.log(replacement); } while (false);
|
11
test/fixtures/javascript/do-while-statement.diffA-B.txt
vendored
Normal file
11
test/fixtures/javascript/do-while-statement.diffA-B.txt
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
(Program
|
||||
(DoWhile
|
||||
(ExpressionStatements
|
||||
(ExpressionStatements
|
||||
(FunctionCall
|
||||
(Identifier)
|
||||
(Identifier)
|
||||
{ (Identifier)
|
||||
->(Identifier) })))
|
||||
{ (Boolean)
|
||||
->(Boolean) }))
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user