2
0
Эх сурвалжийг харах

don't double-throw all exceptions

closes #11175
Simon Krajewski 1 жил өмнө
parent
commit
67e7ef24d9

+ 1 - 1
src/filters/exceptions.ml

@@ -204,7 +204,7 @@ let throw_native ctx e_thrown t p =
 		else
 			e_thrown
 	in
-	mk (TThrow e_native) t p
+	e_native
 
 let set_needs_exception_stack v =
 	if not (Meta.has Meta.NeedsExceptionStack v.v_meta) then

+ 11 - 0
tests/optimization/src/issues/Issue11175.hx

@@ -0,0 +1,11 @@
+package issues;
+
+class Issue11175 {
+	@:js('
+		throw haxe_Exception.thrown("foo");
+	')
+	@:analyzer(ignore)
+	static function test() {
+		throw "foo";
+	}
+}