mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 09:59:17 +02:00
pastojs: fixed exit in program begin-end
git-svn-id: trunk@35905 -
This commit is contained in:
parent
c212a71dff
commit
b4a4ad725c
@ -6005,7 +6005,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
// without parameter.
|
// without parameter.
|
||||||
ProcEl:=El.Parent;
|
ProcEl:=El.Parent;
|
||||||
while not (ProcEl is TPasProcedure) do ProcEl:=ProcEl.Parent;
|
while (ProcEl<>nil) and not (ProcEl is TPasProcedure) do
|
||||||
|
ProcEl:=ProcEl.Parent;
|
||||||
if ProcEl is TPasFunction then
|
if ProcEl is TPasFunction then
|
||||||
// in a function, "return result;"
|
// in a function, "return result;"
|
||||||
TJSReturnStatement(Result).Expr:=CreateBuiltInIdentifierExpr(ResolverResultVar)
|
TJSReturnStatement(Result).Expr:=CreateBuiltInIdentifierExpr(ResolverResultVar)
|
||||||
|
@ -2119,7 +2119,10 @@ begin
|
|||||||
' return Result;',
|
' return Result;',
|
||||||
'};'
|
'};'
|
||||||
]),
|
]),
|
||||||
'');
|
LinesToStr([
|
||||||
|
'return;',
|
||||||
|
'return 1;',
|
||||||
|
'']));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TTestModule.TestBreak;
|
procedure TTestModule.TestBreak;
|
||||||
|
Loading…
Reference in New Issue
Block a user