Nicolas Cannasse 17 years ago
parent
commit
0ea256d4e9
3 changed files with 15 additions and 4 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 9 1
      std/js/Boot.hx
  3. 5 3
      std/js/XMLHttpRequest.hx

+ 1 - 0
doc/CHANGES.txt

@@ -10,6 +10,7 @@ TODO inlining : substitute class+function type parameters in order to have fully
 	genneko : remove big array error (fixed in neko 1.7.1)
 	fixed neko.net.ThreadRemotingServer.onXML
 	genswf9 : fixed verify error with Null<Class> (was using dynamic access)
+	small patch for jsfl support
 
 2008-04-05: 1.19
 	fixed flash9 Array.toString

+ 9 - 1
std/js/Boot.hx

@@ -33,21 +33,29 @@ class Boot {
 	private static function __trace(v,i : haxe.PosInfos) {
 		untyped {
 			var msg = if( i != null ) i.fileName+":"+i.lineNumber+": " else "";
+			#if jsfl
+			msg += __string_rec(v,"");
+			fl.trace(msg);
+			#else true
 			msg += __unhtml(__string_rec(v,""))+"<br/>";
-
 			var d = document.getElementById("haxe:trace");
 			if( d == null )
 				alert("No haxe:trace element defined\n"+msg);
 			else
 				d.innerHTML += msg;
+			#end
 		}
 	}
 
 	private static function __clear_trace() {
 		untyped {
+			#if jsfl
+			fl.outputPanel.clear();
+			#else true
 			var d = document.getElementById("haxe:trace");
 			if( d != null )
 				d.innerHTML = "";
+			#end
 		}
 	}
 

+ 5 - 3
std/js/XMLHttpRequest.hx

@@ -43,13 +43,14 @@ extern class XMLHttpRequest {
 	function open( method : String, url : String, async : Bool ) : Void;
 	function send( content : String ) : Void;
 
+	#if !jsfl
 	private static function __init__() : Void {
 		untyped
-		js["XMLHttpRequest"] = 
+		js["XMLHttpRequest"] =
 			if( window.XMLHttpRequest )
 				__js__("XMLHttpRequest");
 			else if( window.ActiveXObject )
-				function() { 
+				function() {
 					try {
 						return __new__("ActiveXObject","Msxml2.XMLHTTP");
 					}catch(e:Dynamic){
@@ -60,8 +61,9 @@ extern class XMLHttpRequest {
 						}
 					}
 				};
-			else 
+			else
 				throw "Unable to create XMLHttpRequest object.";
 	}
+	#end
 
 }