Browse Source

pas2js: Pascal descendent from JS function: inherited calls ancestor function

git-svn-id: trunk@45709 -
Mattias Gaertner 5 years ago
parent
commit
dbc0a689f0

+ 1 - 1
packages/pastojs/src/fppas2js.pp

@@ -743,7 +743,7 @@ const
     'xor', // pbifnBitwiseNativeIntXor,
     'checkMethodCall', // pbifnCheckMethodCall
     'checkVersion', // pbifnCheckVersion
-    '$func', // pbifnClassAncestorFunc
+    '$ancestorfunc', // pbifnClassAncestorFunc
     '$destroy', // pbifnClassInstanceFree
     '$create', // pbifnClassInstanceNew
     'createClass', // pbifnCreateClass   rtl.createClass

+ 1 - 1
packages/pastojs/tests/tcmodules.pas

@@ -17534,7 +17534,7 @@ begin
     '  this.$final = function () {',
     '  };',
     '  this.Create = function (a) {',
-    '    this.$func(a);',
+    '    this.$ancestorfunc(a);',
     '    return this;',
     '  };',
     '});',

+ 1 - 0
utils/pas2js/dist/rtl.js

@@ -396,6 +396,7 @@ var rtl = {
       function f(){}
       f.prototype = c;
       c.$func = f;
+      c.$ancestorfunc = ancestor;
     }
   },