Skip to content

Commit 5fa9789

Browse files
committed
Implement Haxe 5's Exception.stack setter
1 parent 4314e42 commit 5fa9789

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

std/cxx/_std/haxe/Exception.hx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Exception extends cxx.std.Exception {
1010
return _message;
1111
}
1212

13-
public var stack(get, never): CallStack;
13+
public var stack(get, #if haxe5 set #else never #end): CallStack;
1414
private function get_stack(): CallStack {
1515
#if cxx_callstack
1616
return _stack;
@@ -19,6 +19,16 @@ class Exception extends cxx.std.Exception {
1919
return [];
2020
#end
2121
}
22+
#if haxe5
23+
private function set_stack(stack: CallStack): CallStack {
24+
#if cxx_callstack
25+
return _stack = stack;
26+
#else
27+
NativeStackTrace.err();
28+
return [];
29+
#end
30+
}
31+
#end
2232

2333
public var previous(get, never): Null<Exception>;
2434
private function get_previous(): Null<Exception> {

0 commit comments

Comments
 (0)