mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-15 14:25:52 +00:00
Bug 906963 - Add extra tests and review suggestions from jimb that I missed
This commit is contained in:
parent
e0552f2a51
commit
88739e94bd
@ -62,3 +62,7 @@ test("function f() { throw new Error(); } try { f(); } catch (e) {}", [true, tru
|
||||
test("function f() { throw new Error(); } try { f(); } catch (e) { throw e; }", [true, true, false]);
|
||||
test("try { eval('throw new Error()'); } catch (e) {}", [true, true]);
|
||||
test("try { eval('throw new Error()'); } catch (e) { throw e; }", [true, true, false]);
|
||||
|
||||
// Should correctly detect catch blocks just before and just after throws
|
||||
test("throw new Error; try {} catch (e) {}", [false]);
|
||||
test("try {} catch (e) {} throw new Error();", [false]);
|
||||
|
@ -3542,7 +3542,8 @@ DebuggerScript_isInCatchScope(JSContext *cx, unsigned argc, Value* vp)
|
||||
JSTryNote* tnBegin = script->trynotes()->vector;
|
||||
JSTryNote* tnEnd = tnBegin + script->trynotes()->length;
|
||||
while (tnBegin != tnEnd) {
|
||||
if (offset - tnBegin->start < tnBegin->length &&
|
||||
if (tnBegin->start <= offset &&
|
||||
offset <= tnBegin->start + tnBegin->length &&
|
||||
tnBegin->kind == JSTRY_CATCH)
|
||||
{
|
||||
args.rval().setBoolean(true);
|
||||
|
Loading…
Reference in New Issue
Block a user