From 062fbb5e414ed520c48fd72b3a6409856c7bbee1 Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Mon, 29 Jun 2020 21:51:00 +0000 Subject: [PATCH] pas2js: doc about extending JS function git-svn-id: trunk@45716 - --- utils/pas2js/docs/translation.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/utils/pas2js/docs/translation.html b/utils/pas2js/docs/translation.html index 910620f468..4c6f671d54 100644 --- a/utils/pas2js/docs/translation.html +++ b/utils/pas2js/docs/translation.html @@ -2888,7 +2888,11 @@ Begin inherited New(b+1); // optional: call inherited constructor function End; +var + f: TMyFunc; Begin + f:=TMyFunc.Create(3); + writeln(jsInstanceOf(f,TExternalFunc)); // writes true, instanceof operator works as expected End. @@ -2904,7 +2908,10 @@ End. this.$ancestorfunc(b+1); }; }); + this.f = null; $mod.$main = function () { + f = $mod.TMyFunc.$create("Create$2",[3]); + pas.System.Writeln(pas.JS.jsInstanceOf(f,ExternalFunc)); }; });