mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 10:09:20 +02:00
fcl-js: test var a=1,b=2,c=3
git-svn-id: trunk@37766 -
This commit is contained in:
parent
effbafabd2
commit
a8f18c29fb
@ -99,6 +99,7 @@ type
|
|||||||
Procedure TestVarDeclarationStatement;
|
Procedure TestVarDeclarationStatement;
|
||||||
Procedure TestVarListDeclarationStatement;
|
Procedure TestVarListDeclarationStatement;
|
||||||
Procedure TestVarListDeclarationStatement2Vars;
|
Procedure TestVarListDeclarationStatement2Vars;
|
||||||
|
Procedure TestVarListDeclarationStatement3Vars;
|
||||||
Procedure TestReturnStatement;
|
Procedure TestReturnStatement;
|
||||||
Procedure TestLabeledStatement;
|
Procedure TestLabeledStatement;
|
||||||
Procedure TestLabeledStatementCompact;
|
Procedure TestLabeledStatementCompact;
|
||||||
@ -957,6 +958,33 @@ begin
|
|||||||
AssertWrite('simple 2 vars','var a, b',S);
|
AssertWrite('simple 2 vars','var a, b',S);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestStatementWriter.TestVarListDeclarationStatement3Vars;
|
||||||
|
Var
|
||||||
|
S : TJSVariableStatement;
|
||||||
|
V : TJSVarDeclaration;
|
||||||
|
L : TJSVariableDeclarationList;
|
||||||
|
|
||||||
|
begin
|
||||||
|
S:=TJSVariableStatement.Create(0,0);
|
||||||
|
L:=TJSVariableDeclarationList.Create(0,0);
|
||||||
|
S.A:=L;
|
||||||
|
V:=TJSVarDeclaration.Create(0,0);
|
||||||
|
L.A:=V;
|
||||||
|
V.Name:='a';
|
||||||
|
V.Init:=CreateLiteral(1);
|
||||||
|
L.B:=TJSVariableDeclarationList.Create(0,0);
|
||||||
|
L:=TJSVariableDeclarationList(L.B);
|
||||||
|
V:=TJSVarDeclaration.Create(0,0);
|
||||||
|
L.A:=V;
|
||||||
|
V.Name:='b';
|
||||||
|
V.Init:=CreateLiteral(2);
|
||||||
|
V:=TJSVarDeclaration.Create(0,0);
|
||||||
|
L.B:=V;
|
||||||
|
V.Name:='c';
|
||||||
|
V.Init:=CreateLiteral(3);
|
||||||
|
AssertWrite('simple 3 vars','var a = 1, b = 2, c = 3',S);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TTestStatementWriter.TestReturnStatement;
|
procedure TTestStatementWriter.TestReturnStatement;
|
||||||
Var
|
Var
|
||||||
S : TJSReturnStatement;
|
S : TJSReturnStatement;
|
||||||
|
Loading…
Reference in New Issue
Block a user