diff --git a/ftk/format/template/Interp.hx b/ftk/format/template/Interp.hx index ef77939..dfb1a1e 100644 --- a/ftk/format/template/Interp.hx +++ b/ftk/format/template/Interp.hx @@ -75,7 +75,7 @@ class Interp { } ); } - hinterp.variables.set( "__toString__", Std.string ); + hinterp.variables.set( "__toString__", __toString__ ); hinterp.variables.set( "__hscriptSource__", function ( __hscriptSource__ ){ if( runtimePos ){ sourcesStack.push( currentSource ); @@ -98,6 +98,10 @@ class Interp { } } + public dynamic function __toString__( o : Null ) : String { + return Std.string( o ); + } + /* * Main function that interprets a template *