#2470 (Javascript) Func.toStr()

SlimerDude Tue 22 Sep 2015

For a long time now I didn't even think Method Funcs had been implemented in Javascript (!) due to:

echo(Obj#echo.func)  // --> undefined

But it turns out Func.toStr() was undefined, not the func itself - D'Oh!

This little one-liner sorted out the confusion:

diff -r 56d95b6fa8ad src/sys/js/fan/Func.js
--- a/src/sys/js/fan/Func.js	Tue Sep 22 09:31:42 2015 -0400
+++ b/src/sys/js/fan/Func.js	Tue Sep 22 20:33:53 2015 +0100
@@ -76,6 +76,8 @@
 fan.sys.Func.prototype.exitCtor = function() {}
 fan.sys.Func.prototype.checkInCtor = function(obj) {}
 
+fan.sys.Func.prototype.toStr = function() { return "sys::Func"; }
+
 /*************************************************************************
  * ClosureFuncSpec
  ************************************************************************/

andy Wed 23 Sep 2015

Login or Signup to reply.