pastojs: resolver: funcresult[]:=

git-svn-id: trunk@38038 -
This commit is contained in:
Mattias Gaertner 2018-01-25 14:16:32 +00:00
parent b6516e053a
commit 57f3e4d1d6

View File

@ -247,6 +247,7 @@ type
Procedure TestImplProc; Procedure TestImplProc;
Procedure TestFunctionResult; Procedure TestFunctionResult;
Procedure TestNestedProc; Procedure TestNestedProc;
Procedure TestNestedProc_ResultString;
Procedure TestForwardProc; Procedure TestForwardProc;
Procedure TestNestedForwardProc; Procedure TestNestedForwardProc;
Procedure TestAssignFunctionResult; Procedure TestAssignFunctionResult;
@ -2375,6 +2376,44 @@ begin
''); '');
end; end;
procedure TTestModule.TestNestedProc_ResultString;
begin
StartProgram(false);
Add([
'function DoIt: string;',
' function Nesty: string; ',
' begin',
' nesty:=#65#66;',
' nesty[1]:=#67;',
' doit:=#68;',
' doit[2]:=#69;',
' end;',
'begin',
' doit:=#70;',
' doit[3]:=#71;',
'end;',
'begin']);
ConvertProgram;
CheckSource('TestNestedProc_ResultString',
LinesToStr([ // statements
'this.DoIt = function () {',
' var Result = "";',
' function Nesty() {',
' var Result$1 = "";',
' Result$1 = "AB";',
' Result$1 = rtl.setCharAt(Result$1, 0, "C");',
' Result = "D";',
' Result = rtl.setCharAt(Result, 1, "E");',
' return Result$1;',
' };',
' Result = "F";',
' Result = rtl.setCharAt(Result, 2, "G");',
' return Result;',
'};'
]),
'');
end;
procedure TTestModule.TestForwardProc; procedure TTestModule.TestForwardProc;
begin begin
StartProgram(false); StartProgram(false);