浏览代码

[cs] Added Lib.rethrow

Cauê Waneck 11 年之前
父节点
当前提交
c4da4d4bfa
共有 1 个文件被更改,包括 9 次插入0 次删除
  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.