mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 04:59:25 +02:00
pastojs: fixed multi add element position
git-svn-id: trunk@49122 -
(cherry picked from commit 204f2a3bc1
)
This commit is contained in:
parent
fabb4b45f3
commit
f90f5a390a
@ -9750,7 +9750,7 @@ begin
|
||||
B:=ConvertExpression(SubBin.right,AContext);
|
||||
if aResolver<>nil then
|
||||
begin
|
||||
aResolver.ComputeElement(El.right,RightResolved,Flags);
|
||||
aResolver.ComputeElement(SubBin.right,RightResolved,Flags);
|
||||
Result:=ConvertBinaryExpressionRes(SubBin,AContext,LeftResolved,RightResolved,A,B);
|
||||
if (Result<>nil) then
|
||||
begin
|
||||
@ -9763,7 +9763,7 @@ begin
|
||||
if Result=nil then
|
||||
begin
|
||||
// +
|
||||
R:=TJSBinary(CreateElement(TJSAdditiveExpressionPlus,El));
|
||||
R:=TJSBinary(CreateElement(TJSAdditiveExpressionPlus,SubBin));
|
||||
R.A:=A; A:=nil;
|
||||
R.B:=B; B:=nil;
|
||||
Result:=R;
|
||||
|
@ -3314,8 +3314,10 @@ procedure TTestModule.TestMultiAdd;
|
||||
begin
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'function Fly: string; external name ''fly'';',
|
||||
'function TryEncodeDate(Year, Month, Day: Word): Boolean;',
|
||||
'var Date: double;',
|
||||
'var',
|
||||
' Date: double;',
|
||||
'begin',
|
||||
' Result:=(Year>0) and (Year<10000) and',
|
||||
' (Month >= 1) and (Month<=12) and',
|
||||
@ -3324,7 +3326,10 @@ begin
|
||||
'end;',
|
||||
'var s: string;',
|
||||
'begin',
|
||||
' s:=''a''+''b''+''c''+''d'';']);
|
||||
' s:=''a''+''b''+''c''+''d'';',
|
||||
' s:=s+Fly+''e'';',
|
||||
' s:=Fly+Fly+Fly;',
|
||||
'']);
|
||||
ConvertProgram;
|
||||
CheckSource('TestMultiAdd',
|
||||
LinesToStr([ // statements
|
||||
@ -3339,6 +3344,8 @@ begin
|
||||
'']),
|
||||
LinesToStr([ // this.$main
|
||||
'$mod.s = "a" + "b" + "c" + "d";',
|
||||
'$mod.s = $mod.s + fly() + "e";',
|
||||
'$mod.s = fly() + fly() + fly();',
|
||||
'']));
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user