From ebaa618ae97f80ba94ea95f09aeded54800586b6 Mon Sep 17 00:00:00 2001 From: filt3rek Date: Wed, 14 Sep 2022 17:26:45 +0200 Subject: [PATCH] Interp dynamic __toString__ --- ftk/format/template/Interp.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 *