summaryrefslogtreecommitdiff
path: root/packages/pastojs/tests
diff options
context:
space:
mode:
authormattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-09-12 07:59:05 +0000
committermattias <mattias@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-09-12 07:59:05 +0000
commit1fa0c181cd29ab6adb96d1a9f13d74143189c4b0 (patch)
tree14c13e2b6394a06ffe60ca3942a34b1438ccf960 /packages/pastojs/tests
parent1637c253ff6714b67ae885eb9095282865c940ca (diff)
downloadfpc-1fa0c181cd29ab6adb96d1a9f13d74143189c4b0.tar.gz
pastojs: jsglobalalias: references in init to elements from implementation uses
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@46854 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/pastojs/tests')
-rw-r--r--packages/pastojs/tests/tcoptimizations.pas6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/pastojs/tests/tcoptimizations.pas b/packages/pastojs/tests/tcoptimizations.pas
index f80f4004d0..bc01348cd2 100644
--- a/packages/pastojs/tests/tcoptimizations.pas
+++ b/packages/pastojs/tests/tcoptimizations.pas
@@ -303,6 +303,8 @@ begin
' end;',
' TBear = class',
' end;',
+ ' TFrog = class',
+ ' end;',
'var Ant: TAnt;',
'']),
LinesToStr([
@@ -347,6 +349,7 @@ begin
' Ant:=TAnt.Create;', // init to impl-uses
' Bird:=TBird.Create;', // init to intf-uses
' Eagle:=TEagle.Create;', // init to intf-JS
+ ' TFrog.Create;', // only in init to impl-uses
' Eagle.Fly;',
' RedAnt.Run;',
'']);
@@ -359,6 +362,7 @@ begin
'var $lm1 = null;',
'var $lt1 = null;',
'var $lt2 = null;',
+ 'var $lt3 = null;',
'rtl.createClass($mod, "TEagle", $lt, function () {',
' this.Fly = function () {',
' $impl.TRedAnt.$create("Create");',
@@ -373,6 +377,7 @@ begin
'$impl.Ant = $lt1.$create("Create");',
'$impl.Bird = $lt.$create("Create");',
'$impl.Eagle = $mod.TEagle.$create("Create");',
+ '$lt3.$create("Create");',
'$impl.Eagle.Fly();',
'$impl.RedAnt.Run();',
'']),
@@ -380,6 +385,7 @@ begin
'$lm1 = pas.UnitB;',
'$lt1 = $lm1.TAnt;',
'$lt2 = $lm1.TBear;',
+ '$lt3 = $lm1.TFrog;',
'rtl.createClass($impl, "TRedAnt", $lt1, function () {',
' this.Run = function () {',
' $impl.TRedAnt.$create("Create");',