|
@@ -102,7 +102,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_RecordEmpty',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.recNewT($mod, "TRecA$G1", function () {',
|
|
|
+ 'rtl.recNewT(this, "TRecA$G1", function () {',
|
|
|
' this.$eq = function (b) {',
|
|
|
' return true;',
|
|
|
' };',
|
|
@@ -110,8 +110,8 @@ begin
|
|
|
' return this;',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'this.a = $mod.TRecA$G1.$new();',
|
|
|
- 'this.b = $mod.TRecA$G1.$new();',
|
|
|
+ 'this.a = this.TRecA$G1.$new();',
|
|
|
+ 'this.b = this.TRecA$G1.$new();',
|
|
|
'']),
|
|
|
LinesToStr([ // $mod.$main
|
|
|
'if ($mod.a.$eq($mod.b)) ;'
|
|
@@ -144,7 +144,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Record_ClassProc',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.recNewT($mod, "TPoint$G1", function () {',
|
|
|
+ 'rtl.recNewT(this, "TPoint$G1", function () {',
|
|
|
' this.x = 0;',
|
|
|
' this.$eq = function (b) {',
|
|
|
' return true;',
|
|
@@ -159,7 +159,7 @@ begin
|
|
|
' $mod.TPoint$G1.Fly();',
|
|
|
' };',
|
|
|
'}, true);',
|
|
|
- 'this.p = $mod.TPoint$G1.$new();',
|
|
|
+ 'this.p = this.TPoint$G1.$new();',
|
|
|
'']),
|
|
|
LinesToStr([ // $mod.$main
|
|
|
'$mod.TPoint$G1.x = $mod.p.x + 10;',
|
|
@@ -187,7 +187,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Record_ClassVarRecord_Program',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.recNewT($mod, "TBird", function () {',
|
|
|
+ 'rtl.recNewT(this, "TBird", function () {',
|
|
|
' this.b = 0;',
|
|
|
' this.$eq = function (b) {',
|
|
|
' return this.b === b.b;',
|
|
@@ -197,7 +197,7 @@ begin
|
|
|
' return this;',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.recNewT($mod, "TAnt$G1", function () {',
|
|
|
+ 'rtl.recNewT(this, "TAnt$G1", function () {',
|
|
|
' this.x = $mod.TBird.$new();',
|
|
|
' this.$eq = function (b) {',
|
|
|
' return true;',
|
|
@@ -206,7 +206,7 @@ begin
|
|
|
' return this;',
|
|
|
' };',
|
|
|
'}, true);',
|
|
|
- 'this.f = $mod.TAnt$G1.$new();',
|
|
|
+ 'this.f = this.TAnt$G1.$new();',
|
|
|
'']),
|
|
|
LinesToStr([ // $mod.$main
|
|
|
'$mod.f.x.b = $mod.f.x.b + 10;',
|
|
@@ -244,7 +244,7 @@ begin
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
' var $impl = $mod.$impl;',
|
|
|
- ' rtl.recNewT($mod, "TAnt$G1", function () {',
|
|
|
+ ' rtl.recNewT(this, "TAnt$G1", function () {',
|
|
|
' this.$initSpec = function () {',
|
|
|
' this.x = $impl.TBird.$new();',
|
|
|
' this.a = rtl.arraySetLength(null, $impl.TBird, 2);',
|
|
@@ -307,7 +307,7 @@ begin
|
|
|
CheckSource('TestGen_Record_RTTI_UnitImpl',
|
|
|
LinesToStr([ // statements
|
|
|
'var $impl = $mod.$impl;',
|
|
|
- 'rtl.recNewT($mod, "TAnt$G1", function () {',
|
|
|
+ 'rtl.recNewT(this, "TAnt$G1", function () {',
|
|
|
' var $r = $mod.$rtti.$Record("TAnt<Test1.TBird>", {});',
|
|
|
' this.$initSpec = function () {',
|
|
|
' this.x = $impl.TBird.$new();',
|
|
@@ -356,13 +356,13 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_ClassEmpty',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
'});',
|
|
|
'this.a = null;',
|
|
|
'this.b = null;',
|
|
@@ -390,13 +390,13 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_EmptyMethod',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.Fly = function (w) {',
|
|
|
' var Result = 0;',
|
|
|
' return Result;',
|
|
@@ -449,13 +449,13 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_TList',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TList$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TList$G1", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.FItems = [];',
|
|
@@ -518,19 +518,19 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_TCustomList',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TCustomList$G2", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TCustomList$G2", this.TObject, function () {',
|
|
|
' this.PrepareAddingItem = function () {',
|
|
|
' var Result = 0;',
|
|
|
' return Result;',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TList$G1", $mod.TCustomList$G2, function () {',
|
|
|
+ 'rtl.createClass(this, "TList$G1", this.TCustomList$G2, function () {',
|
|
|
' this.Add = function () {',
|
|
|
' var Result = 0;',
|
|
|
' Result = this.PrepareAddingItem();',
|
|
@@ -559,15 +559,15 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_ClassAncestor',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G2", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G2", this.TObject, function () {',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TEagle$G1", $mod.TBird$G2, function () {',
|
|
|
+ 'rtl.createClass(this, "TEagle$G1", this.TBird$G2, function () {',
|
|
|
'});',
|
|
|
'this.a = null;',
|
|
|
'']),
|
|
@@ -598,13 +598,13 @@ begin
|
|
|
CheckSource('TestGen_Class_TypeInfo',
|
|
|
LinesToStr([ // statements
|
|
|
'$mod.$rtti.$Class("TBird<System.Word>");',
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.m = 0;',
|
|
@@ -643,7 +643,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_TypeOverload',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
@@ -674,13 +674,13 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_ClassProperty',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.fSize = 0;',
|
|
|
'});',
|
|
|
'']),
|
|
@@ -724,13 +724,13 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_ClassProc',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TPoint$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TPoint$G1", this.TObject, function () {',
|
|
|
' this.x = 0;',
|
|
|
' this.Fly = function () {',
|
|
|
' $mod.TPoint$G1.x = $mod.TPoint$G1.x + 3;',
|
|
@@ -787,20 +787,20 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_ClassConstructor',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
'this.count = 0;',
|
|
|
- 'rtl.createClass($mod, "TPoint$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TPoint$G1", this.TObject, function () {',
|
|
|
' this.x = 0;',
|
|
|
' this.Fly = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
'this.r = null;',
|
|
|
- 'rtl.createClass($mod, "TPoint$G2", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TPoint$G2", this.TObject, function () {',
|
|
|
' this.x = 0;',
|
|
|
' this.Fly = function () {',
|
|
|
' };',
|
|
@@ -845,19 +845,19 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_TypeCastSpecializesWarn',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.F = 0;',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G2", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G2", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.F = "";',
|
|
@@ -893,19 +893,19 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_Class_TypeCastSpecializesJSValueNoWarn',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.F = 0;',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G2", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G2", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.F = undefined;',
|
|
@@ -1001,7 +1001,7 @@ begin
|
|
|
LinesToStr([ // statements
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
- ' rtl.createClass($mod, "TBird$G1", pas.system.TObject, function () {',
|
|
|
+ ' rtl.createClass(this, "TBird$G1", pas.system.TObject, function () {',
|
|
|
' this.c = 13;',
|
|
|
' var c$1 = 14;',
|
|
|
' this.Create$1 = function (w) {',
|
|
@@ -1012,7 +1012,7 @@ begin
|
|
|
' return this;',
|
|
|
' };',
|
|
|
' });',
|
|
|
- ' rtl.createClass($mod, "TBird$G2", pas.system.TObject, function () {',
|
|
|
+ ' rtl.createClass(this, "TBird$G2", pas.system.TObject, function () {',
|
|
|
' this.c = 13;',
|
|
|
' var c$1 = 14;',
|
|
|
' this.Create$1 = function (w) {',
|
|
@@ -1072,15 +1072,15 @@ begin
|
|
|
LinesToStr([ // statements
|
|
|
'$mod.$rtti.$Class("TAnt<System.Word>");',
|
|
|
'$mod.$rtti.$Class("TFish<System.Word>");',
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TPersistent", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TPersistent", this.TObject, function () {',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TAnt$G2", $mod.TPersistent, function () {',
|
|
|
+ 'rtl.createClass(this, "TAnt$G2", this.TPersistent, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TPersistent.$init.call(this);',
|
|
|
' this.f = null;',
|
|
@@ -1092,7 +1092,7 @@ begin
|
|
|
' var $r = this.$rtti;',
|
|
|
' $r.addField("f", $mod.$rtti["TFish<System.Word>"]);',
|
|
|
'}, "TAnt<System.Word>");',
|
|
|
- 'rtl.createClass($mod, "TFish$G2", $mod.TPersistent, function () {',
|
|
|
+ 'rtl.createClass(this, "TFish$G2", this.TPersistent, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TPersistent.$init.call(this);',
|
|
|
' this.a = null;',
|
|
@@ -1144,7 +1144,7 @@ begin
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
' var $impl = $mod.$impl;',
|
|
|
- ' rtl.createClass($mod, "TAnt$G1", pas.system.TObject, function () {',
|
|
|
+ ' rtl.createClass(this, "TAnt$G1", pas.system.TObject, function () {',
|
|
|
' this.$initSpec = function () {',
|
|
|
' this.x = $impl.TBird.$new();',
|
|
|
' this.a = rtl.arraySetLength(null, $impl.TBird, 2);',
|
|
@@ -1312,11 +1312,11 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_ExtClass_RTTI',
|
|
|
LinesToStr([ // statements
|
|
|
- '$mod.$rtti.$ExtClass("TGJSSET<System.JSValue>", {',
|
|
|
+ 'this.$rtti.$ExtClass("TGJSSET<System.JSValue>", {',
|
|
|
' jsclass: "SET"',
|
|
|
'});',
|
|
|
- '$mod.$rtti.$RefToProcVar("TJSSetEventProc", {',
|
|
|
- ' procsig: rtl.newTIProcSig([["value", rtl.jsvalue], ["key", rtl.nativeint], ["set_", $mod.$rtti["TGJSSET<System.JSValue>"]]])',
|
|
|
+ 'this.$rtti.$RefToProcVar("TJSSetEventProc", {',
|
|
|
+ ' procsig: rtl.newTIProcSig([["value", rtl.jsvalue], ["key", rtl.nativeint], ["set_", this.$rtti["TGJSSET<System.JSValue>"]]])',
|
|
|
'});',
|
|
|
'this.p = null;',
|
|
|
'']),
|
|
@@ -1358,7 +1358,7 @@ begin
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
' var $impl = $mod.$impl;',
|
|
|
- ' $mod.$rtti.$ExtClass("TAnt<UnitA.TBird>", {',
|
|
|
+ ' this.$rtti.$ExtClass("TAnt<UnitA.TBird>", {',
|
|
|
' jsclass: "SET"',
|
|
|
' });',
|
|
|
' $mod.$implcode = function () {',
|
|
@@ -1422,15 +1422,15 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_ClassInterface_Corba',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createInterface($mod, "IUnknown", "{00000000-0000-0000-C000-000000000046}", [], null);',
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createInterface(this, "IUnknown", "{00000000-0000-0000-C000-000000000046}", [], null);',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createInterface($mod, "IBird$G2", "{33AB51C6-6240-3BDF-B4B0-D48A593EAB0A}", ["GetSize", "SetSize", "DoIt"], $mod.IUnknown);',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createInterface(this, "IBird$G2", "{33AB51C6-6240-3BDF-B4B0-D48A593EAB0A}", ["GetSize", "SetSize", "DoIt"], this.IUnknown);',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' rtl.addIntf(this, $mod.IBird$G2);',
|
|
|
'});',
|
|
|
'this.BirdIntf = null;',
|
|
@@ -1461,9 +1461,9 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_ClassInterface_InterfacedObject',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createInterface($mod, "IComparer$G2", "{505778ED-F783-4456-9691-32F419CC5E18}", ["Compare"], pas.system.IUnknown);',
|
|
|
+ 'rtl.createInterface(this, "IComparer$G2", "{505778ED-F783-4456-9691-32F419CC5E18}", ["Compare"], pas.system.IUnknown);',
|
|
|
'this.aComparer = null;',
|
|
|
- 'rtl.createClass($mod, "TComparer$G1", pas.system.TInterfacedObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TComparer$G1", pas.system.TInterfacedObject, function () {',
|
|
|
' this.Compare = function (Left, Right) {',
|
|
|
' var Result = 0;',
|
|
|
' return Result;',
|
|
@@ -1497,7 +1497,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_InlineSpec_Constructor',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
@@ -1506,7 +1506,7 @@ begin
|
|
|
' return this;',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
'});',
|
|
|
'this.b = null;',
|
|
|
'']),
|
|
@@ -1546,13 +1546,13 @@ begin
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
' var $impl = $mod.$impl;',
|
|
|
- ' rtl.createClass($mod, "TBird$G1", pas.system.TObject, function () {',
|
|
|
+ ' rtl.createClass(this, "TBird$G1", pas.system.TObject, function () {',
|
|
|
' this.Fly = function () {',
|
|
|
' $impl.DoIt();',
|
|
|
' };',
|
|
|
' });',
|
|
|
' this.b = null;',
|
|
|
- ' rtl.createClass($mod, "TBird$G2", pas.system.TObject, function () {',
|
|
|
+ ' rtl.createClass(this, "TBird$G2", pas.system.TObject, function () {',
|
|
|
' this.Fly = function () {',
|
|
|
' $impl.DoIt();',
|
|
|
' };',
|
|
@@ -1589,13 +1589,13 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_IntAssignTemplVar',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.m = 0;',
|
|
@@ -1636,14 +1636,14 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_TypeCastDotField',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
|
' };',
|
|
|
'});',
|
|
|
'this.o = null;',
|
|
|
- 'rtl.createClass($mod, "TBird$G1", $mod.TObject, function () {',
|
|
|
+ 'rtl.createClass(this, "TBird$G1", this.TObject, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' $mod.TObject.$init.call(this);',
|
|
|
' this.Field = 0;',
|
|
@@ -1682,7 +1682,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGen_HelperForArray',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createHelper($mod, "TWordArrHelper", null, function () {',
|
|
|
+ 'rtl.createHelper(this, "TWordArrHelper", null, function () {',
|
|
|
' this.Fly = function (w) {',
|
|
|
' };',
|
|
|
'});',
|
|
@@ -2013,7 +2013,7 @@ begin
|
|
|
ConvertProgram;
|
|
|
CheckSource('TestGenMethod_ObjFPC',
|
|
|
LinesToStr([ // statements
|
|
|
- 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
+ 'rtl.createClass(this, "TObject", null, function () {',
|
|
|
' this.$init = function () {',
|
|
|
' };',
|
|
|
' this.$final = function () {',
|
|
@@ -2069,13 +2069,13 @@ begin
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
' var $impl = $mod.$impl;',
|
|
|
- ' $mod.$rtti.$DynArray("TDyn<UnitA.TBird>", {});',
|
|
|
+ ' this.$rtti.$DynArray("TDyn<UnitA.TBird>", {});',
|
|
|
' this.TStatic$G1$clone = function (a) {',
|
|
|
' var r = [];',
|
|
|
' for (var i = 0; i < 2; i++) r.push($impl.TBird.$clone(a[i]));',
|
|
|
' return r;',
|
|
|
' };',
|
|
|
- ' $mod.$rtti.$StaticArray("TStatic<UnitA.TBird>", {',
|
|
|
+ ' this.$rtti.$StaticArray("TStatic<UnitA.TBird>", {',
|
|
|
' dims: [2]',
|
|
|
' });',
|
|
|
' $mod.$implcode = function () {',
|
|
@@ -2195,7 +2195,7 @@ begin
|
|
|
'rtl.module("UnitA", ["system"], function () {',
|
|
|
' var $mod = this;',
|
|
|
' var $impl = $mod.$impl;',
|
|
|
- ' $mod.$rtti.$ProcVar("TAnt<UnitA.TBird>", {',
|
|
|
+ ' this.$rtti.$ProcVar("TAnt<UnitA.TBird>", {',
|
|
|
' init: function () {',
|
|
|
' this.procsig = rtl.newTIProcSig([["a", $mod.$rtti["TBird"], 2]], $mod.$rtti["TBird"]);',
|
|
|
' }',
|