Open
Bug 1470022
Opened 7 years ago
Updated 3 years ago
Document and test Debugger {return:} resumption interaction with try/finally
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: jorendorff, Unassigned)
References
(Blocks 1 open bug)
Details
function f() {
try {
debugger;
} finally {
print("got here");
}
}
If an onDebuggerStatement handler returns `{return: "ok!"}`, the `finally` block should execute, and then the function should return `"ok!"`. I think this is how it works, at least in the interpreter, but I haven't tried it. It is not documented or tested anywhere.
| Reporter | ||
Comment 1•7 years ago
|
||
Now I think finally blocks do *not* execute; both baseline and the interpreter have a special bit of code to set the pc to the end of the script in this case.
It's too bad. One reason to prefer running finally blocks is that that's what `gen.return(x)` does.
Another argument: you're a C++ programmer. What would you want if your use a debugger to force-return from a function? You definitely want the destructors to run. Otherwise the program will very likely leak resources or much worse.
| Reporter | ||
Updated•7 years ago
|
Priority: -- → P3
Updated•5 years ago
|
Blocks: js-debugger
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•