Skip to content

Commit

Permalink
Merge pull request #9 from ccapndave/master
Browse files Browse the repository at this point in the history
Updating js.Boot.__trace
  • Loading branch information
cloudshift committed Jun 1, 2012
2 parents 0864aa5 + 7d24f10 commit 6883a7c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions js/Boot.hx
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ class Boot {
private static function __unhtml(s : String) { private static function __unhtml(s : String) {
return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;"); return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
} }

private static function __trace(v,i : haxe.PosInfos) { private static function __trace(v,i : haxe.PosInfos) {
untyped { untyped {
var msg = if( i != null ) i.fileName+":"+i.lineNumber+": " else ""; var msg = if( i != null ) i.fileName+":"+i.lineNumber+": " else "";
#if jsfl #if jsfl
msg += __string_rec(v,""); msg += __string_rec(v,"");
fl.trace(msg); fl.trace(msg);
#elseif nodejs #elseif nodejs
msg += __string_rec(v,""); msg += __string_rec(v,"");
Node.console.log(msg); Node.console.log(msg);
#else #else
msg += __unhtml(__string_rec(v,""))+"<br/>"; msg += __string_rec(v,"");
var d = document.getElementById("haxe:trace"); var d = document.getElementById("haxe:trace");
if( d == null ) if( d != null )
alert("No haxe:trace element defined\n"+msg); d.innerHTML += __unhtml(msg)+"<br/>";
else else if( __js__("typeof")(console) != "undefined" && console.log != null )
d.innerHTML += msg; console.log(msg);
#end #end
} }
} }
Expand Down

0 comments on commit 6883a7c

Please sign in to comment.