Browse Source

[cs] Added Lib.rethrow

Cauê Waneck 11 years ago
parent
commit
c4da4d4bfa
1 changed files with 9 additions and 0 deletions
  1. 9 0
      std/cs/Lib.hx

+ 9 - 0
std/cs/Lib.hx

@@ -137,6 +137,15 @@ class Lib
 		return untyped Array.alloc(size);
 	}
 
+	/**
+		Rethrow an exception. This is useful when manually filtering an exception in order
+		to keep the previous exception stack.
+	**/
+	@:extern inline public static function rethrow(e:Dynamic):Void
+	{
+		untyped __rethrow__();
+	}
+
 	/**
 		Creates a "checked" block, which throws exceptions for overflows.