pastojs: fixed exit in program begin-end

git-svn-id: trunk@35905 -
This commit is contained in:
Mattias Gaertner 2017-04-22 15:53:07 +00:00
parent c212a71dff
commit b4a4ad725c
2 changed files with 6 additions and 2 deletions
packages/pastojs

View File

@ -6005,7 +6005,8 @@ begin
begin
// without parameter.
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
// in a function, "return result;"
TJSReturnStatement(Result).Expr:=CreateBuiltInIdentifierExpr(ResolverResultVar)

View File

@ -2119,7 +2119,10 @@ begin
' return Result;',
'};'
]),
'');
LinesToStr([
'return;',
'return 1;',
'']));
end;
procedure TTestModule.TestBreak;