Closed Bug 1270610 Opened 9 years ago Closed 9 years ago

Capture a stack trace for non-ErrorObject exceptions

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 996060

People

(Reporter: ehsan.akhgari, Unassigned)

Details

(Whiteboard: [v8api])

Right now for things such as |throw "foo";| SpiderMonkey doesn't capture a stack trace since the stack trace can only be attached to ErrorObject. This makes it impossible to implement some of the V8 APIs that expose information such as line and column for exceptions. We can probably do this by capturing a single stack frame in JSContext::setPendingException, except that function covers more than just throw points (for example when restoring an exception at the end of a finally block.) Perhaps we could add another internal API that designates throw points only and do this work there. More concrete ideas welcome!
This seems eminently doable. We already have the choke point: JSContext::setPendingException(). We already have an efficient way to save stacks.
We have this feature already on requested over at bug 996060.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.