Sort out error-reporting behavior of EvaluateString callers

NEW
Unassigned

Status

()

Core
DOM
13 years ago
9 years ago

People

(Reporter: bz, Unassigned)

Tracking

Trunk
Points:
---
Bug Flags:
blocking1.9 -
wanted1.9 +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

We have three callers of EvaluateString that are inside Gecko:

1) nsScriptLoader
2) javascript: URLs
3) timeouts/intervals

Right now, if the string passed to EvaluateString throws we set the "exception is pending" boolean on the current XPCCallContext and return.  This misses reporting errors in many cases (like the example in the URL field).

So for each of those three cases I think we need to decide on the following:

1)  Should an exception from the JS in question propagate to the caller?  That is, should setting window.location to a javascript: URI that throws rethrow that exception in the calling context?  Should appending a <script> node that contains text that throws an exception throw from appendChild?  That sort of thing.

2)  Based on the answers to #1 figure out how to implement.  I suspect that no matter what we'll need to remove the NotifyXPCIfExceptionPending() call from EvaluateString, since it doesn't, generally speaking, do the right thing.  See bug 328851.
Flags: blocking1.9a1?
OS: Linux → All
Hardware: PC → All
Version: 1.8 Branch → Trunk
Flags: blocking1.9a1? → blocking1.9-
Whiteboard: [wanted-1.9]
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Assignee: general → nobody
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.