|
@@ -167,6 +167,7 @@ type
|
|
Procedure TestFunctionDefBody1Compact;
|
|
Procedure TestFunctionDefBody1Compact;
|
|
Procedure TestFunctionDefBody2;
|
|
Procedure TestFunctionDefBody2;
|
|
Procedure TestFunctionDefBody2Compact;
|
|
Procedure TestFunctionDefBody2Compact;
|
|
|
|
+ Procedure TestFunctionDefAsync;
|
|
Procedure TestTryCatch;
|
|
Procedure TestTryCatch;
|
|
Procedure TestTryCatchCompact;
|
|
Procedure TestTryCatchCompact;
|
|
Procedure TestTryFinally;
|
|
Procedure TestTryFinally;
|
|
@@ -193,6 +194,7 @@ type
|
|
Procedure TestUnaryDelete;
|
|
Procedure TestUnaryDelete;
|
|
Procedure TestUnaryVoid;
|
|
Procedure TestUnaryVoid;
|
|
Procedure TestUnaryTypeOf;
|
|
Procedure TestUnaryTypeOf;
|
|
|
|
+ Procedure TestUnaryAwait;
|
|
Procedure TestPrefixPlusPLus;
|
|
Procedure TestPrefixPlusPLus;
|
|
Procedure TestPrefixMinusMinus;
|
|
Procedure TestPrefixMinusMinus;
|
|
Procedure TestUnaryMinus;
|
|
Procedure TestUnaryMinus;
|
|
@@ -347,6 +349,11 @@ begin
|
|
TestUnary('typeof expresssion',TJSUnaryTypeOfExpression,'typeof a');
|
|
TestUnary('typeof expresssion',TJSUnaryTypeOfExpression,'typeof a');
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TTestExpressionWriter.TestUnaryAwait;
|
|
|
|
+begin
|
|
|
|
+ TestUnary('await expresssion',TJSAwaitExpression,'await a');
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TTestExpressionWriter.TestPrefixPlusPLus;
|
|
procedure TTestExpressionWriter.TestPrefixPlusPLus;
|
|
begin
|
|
begin
|
|
TestUnary('prefix ++ expresssion',TJSUnaryPrePlusPlusExpression,'++a');
|
|
TestUnary('prefix ++ expresssion',TJSUnaryPrePlusPlusExpression,'++a');
|
|
@@ -1902,6 +1909,21 @@ begin
|
|
AssertWrite('Function, 2 statements, compact','function a(b) {b=b*10; return b}',FD);
|
|
AssertWrite('Function, 2 statements, compact','function a(b) {b=b*10; return b}',FD);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TTestStatementWriter.TestFunctionDefAsync;
|
|
|
|
+
|
|
|
|
+Var
|
|
|
|
+ FD : TJSFunctionDeclarationStatement;
|
|
|
|
+
|
|
|
|
+begin
|
|
|
|
+ FD:=TJSFunctionDeclarationStatement.Create(0,0);
|
|
|
|
+ FD.AFunction:=TJSFuncDef.Create;
|
|
|
|
+ FD.AFunction.IsAsync:=true;
|
|
|
|
+ FD.AFunction.Name:='a';
|
|
|
|
+ AssertWrite('Async function',
|
|
|
|
+ 'async function a() {'+sLineBreak
|
|
|
|
+ +'}',FD);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TTestStatementWriter.TestTryCatch;
|
|
procedure TTestStatementWriter.TestTryCatch;
|
|
|
|
|
|
Var
|
|
Var
|