Skip to content

Commit 88bb6af

Browse files
committed
test double set_stack
see #12213
1 parent fc9f5b4 commit 88bb6af

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

std/js/_std/haxe/Exception.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Exception extends NativeException {
113113
@:noCompletion
114114
function setProperty(name:String, value:Any):Void {
115115
try {
116-
js.lib.Object.defineProperty(this, name, {value:value});
116+
js.lib.Object.defineProperty(this, name, {value:value, writable: true});
117117
} catch(e:Exception) {
118118
js.Syntax.code('{0}[{1}] = {2}', this, name, value);
119119
}

tests/unit/src/unit/issues/Issue12213.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class Issue12213 extends Test {
1515
Method("Class", "method"),
1616
LocalFunction(0)
1717
];
18+
e.stack = [];
19+
// test if we can set again because that might be a special case
1820
e.stack = stack;
1921
utest.Assert.same(stack, e.stack);
2022
}

0 commit comments

Comments
 (0)