mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 00:50:49 +02:00
pastojs: resolver: funcresult[]:=
git-svn-id: trunk@38038 -
This commit is contained in:
parent
b6516e053a
commit
57f3e4d1d6
@ -247,6 +247,7 @@ type
|
||||
Procedure TestImplProc;
|
||||
Procedure TestFunctionResult;
|
||||
Procedure TestNestedProc;
|
||||
Procedure TestNestedProc_ResultString;
|
||||
Procedure TestForwardProc;
|
||||
Procedure TestNestedForwardProc;
|
||||
Procedure TestAssignFunctionResult;
|
||||
@ -2375,6 +2376,44 @@ begin
|
||||
'');
|
||||
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;
|
||||
begin
|
||||
StartProgram(false);
|
||||
|
Loading…
Reference in New Issue
Block a user