Smart pascal source code
var proc := @TObject.ClassType;
WriteLn(proc.ClassName);
{<<< RESULT - CONSOLE LOG >>>
-----------------------------
TObject
-----------------------------
{<<<<<<<<< THE END >>>>>>>>>}
var TObject={
$ClassName: "TObject",
$Parent: null,
ClassName: function (s) { return s.$ClassName },
ClassType: function (s) { return s },
ClassParent: function (s) { return s.$Parent },
$Init: function () {},
Create: function (s) { return s },
Destroy: function (s) { for (var prop in s) if (s.hasOwnProperty(prop)) delete s.prop },
Destroy$: function(s) { return s.ClassType.Destroy(s) },
Free: function (s) { if (s!==null) s.ClassType.Destroy(s) }
}
var Exception={
$ClassName: "Exception",
$Parent: TObject,
$Init: function () { FMessage="" },
Create: function (s,Msg) { s.FMessage=Msg; return s }
}
function $New(c) { var i={ClassType:c}; c.$Init(i); return i }
function $Event0(i,f) {
var li=i,lf=f;
return function() {
return lf.call(li,li)
}
}
function $CheckFunc(i,z) { if (i) return i; throw Exception.Create($New(Exception),"Function pointer is nil"+z); }
function $Check(i,z) { if (i) return i; throw Exception.Create($New(Exception),"Object not instantiated"+z); }
function WriteLn(value) {
if (window.console) { window.console.log(value); } };
function ClassName$1(Self$1) {
return "Helper1."+TObject.ClassName($Check(Self$1,""));
}
var proc = null;
/* <<< main JS >>> */
proc = $Event0(TObject,TObject.ClassType);
WriteLn(ClassName$1($CheckFunc(proc,"")()));