Open Bug 656760 Opened 14 years ago Updated 2 years ago

What frame will catch this exception?

Categories

(Core :: JavaScript Engine, enhancement)

enhancement

Tracking

()

People

(Reporter: sfink, Unassigned)

References

(Blocks 1 open bug)

Details

In a hook triggered by an exception being thrown, the JS engine should be able to scan the stack to find the frame that will catch the exception, if any.

Complications I can think of: (1) the user might use heuristics to decide whether a given frame is just going to re-throw the exception, in which case it would want to restart the scan from the next older frame. Or make the API per-frame: "would this frame catch my exception?" (2) If natives want to play nicely, we'd need a way for them to register catchers. And make 'frame' mean JS frame or C frame-like thing. Otherwise no answer can be trusted -- a frame might rethrow an exception, and a native might catch an exception that no JS frame would catch.
Blocks: js::dbg2
see also Bug 636057
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.