mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix bug in Debug::hasAnyLiveHooks.
This commit is contained in:
parent
19c1ad7ee1
commit
2ed818c0ac
22
js/src/jit-test/tests/debug/gc-08.js
Normal file
22
js/src/jit-test/tests/debug/gc-08.js
Normal file
@ -0,0 +1,22 @@
|
||||
// |jit-test| debug
|
||||
// Debuggers with enabled throw hooks should not be GC'd even if they are
|
||||
// otherwise unreachable.
|
||||
|
||||
load(libdir + "asserts.js");
|
||||
|
||||
var g = newGlobal('new-compartment');
|
||||
var actual = 0;
|
||||
var expected = 0;
|
||||
|
||||
function f() {
|
||||
for (var i = 0; i < 20; i++) {
|
||||
var dbg = new Debug(g);
|
||||
dbg.hooks = {num: i, throw: function (stack, exc) { actual += this.num; }};
|
||||
expected += i;
|
||||
}
|
||||
}
|
||||
|
||||
f();
|
||||
gc();
|
||||
assertThrowsValue(function () { g.eval("throw 'fit';"); }, "fit");
|
||||
assertEq(actual, expected);
|
@ -214,7 +214,7 @@ class Debug {
|
||||
bool
|
||||
Debug::hasAnyLiveHooks() const
|
||||
{
|
||||
return observesDebuggerStatement();
|
||||
return enabled && (hasDebuggerHandler || hasThrowHandler);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user