Browse Source

Use the non-standard JS error stack for now.

It doesn't seem like this uses source mapping unfortunately. But better than nothing.
Bruno Garcia 13 years ago
parent
commit
e3fc50e785
1 changed files with 6 additions and 2 deletions
  1. 6 2
      tests/unit/Test.hx

+ 6 - 2
tests/unit/Test.hx

@@ -154,7 +154,11 @@ class Test #if swf_mark implements mt.Protect #end #if as3 implements haxe.Publi
 
 
 	static function onError( e : Dynamic, msg : String, context : String ) {
 	static function onError( e : Dynamic, msg : String, context : String ) {
 		var msg = "???";
 		var msg = "???";
-		var stack = haxe.Stack.toString(haxe.Stack.exceptionStack());
+		var stack :String = #if js
+			e.stack;
+		#else
+			haxe.Stack.toString(haxe.Stack.exceptionStack());
+		#end
 		try msg = Std.string(e) catch( e : Dynamic ) {};
 		try msg = Std.string(e) catch( e : Dynamic ) {};
 		reportCount = 0;
 		reportCount = 0;
 		report("ABORTED : "+msg+" in "+context);
 		report("ABORTED : "+msg+" in "+context);
@@ -229,4 +233,4 @@ class Test #if swf_mark implements mt.Protect #end #if as3 implements haxe.Publi
 		#end
 		#end
 	}
 	}
 
 
-}
+}