Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9 from ccapndave/master

Updating js.Boot.__trace
  • Loading branch information...
commit 6883a7c880192659f81866bfe66a14c85865ea40 2 parents 0864aa5 + 7d24f10
Ritchie Turner authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 js/Boot.hx
18 js/Boot.hx
View
@@ -33,7 +33,7 @@ class Boot {
private static function __unhtml(s : String) {
return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;");
}
-
+
private static function __trace(v,i : haxe.PosInfos) {
untyped {
var msg = if( i != null ) i.fileName+":"+i.lineNumber+": " else "";
@@ -41,15 +41,15 @@ class Boot {
msg += __string_rec(v,"");
fl.trace(msg);
#elseif nodejs
- msg += __string_rec(v,"");
- Node.console.log(msg);
- #else
- msg += __unhtml(__string_rec(v,""))+"<br/>";
+ msg += __string_rec(v,"");
+ Node.console.log(msg);
+ #else
+ msg += __string_rec(v,"");
var d = document.getElementById("haxe:trace");
- if( d == null )
- alert("No haxe:trace element defined\n"+msg);
- else
- d.innerHTML += msg;
+ if( d != null )
+ d.innerHTML += __unhtml(msg)+"<br/>";
+ else if( __js__("typeof")(console) != "undefined" && console.log != null )
+ console.log(msg);
#end
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.