Browse Source

add test for calling CallStack exceptionStack without previous error

frabbit 10 years ago
parent
commit
47778f99f2
1 changed files with 8 additions and 0 deletions
  1. 8 0
      tests/unit/src/unitstd/haxe/CallStack.unit.hx

+ 8 - 0
tests/unit/src/unitstd/haxe/CallStack.unit.hx

@@ -10,3 +10,11 @@ try {
     var stack = haxe.CallStack.exceptionStack();
     Std.is(stack, Array) == true;
 }
+#if js
+var old = @:privateAccess haxe.CallStack.lastException;
+@:privateAccess haxe.CallStack.lastException = null;
+var stack = haxe.CallStack.exceptionStack();
+Std.is(stack, Array) == true;
+stack.length == 0;
+@:privateAccess haxe.CallStack.lastException = old;
+#end