Components.utils.evalInSandbox does not report errors

RESOLVED FIXED in mozilla1.8beta4

Status

()

P1
normal
RESOLVED FIXED
14 years ago
13 years ago

People

(Reporter: brendan, Assigned: brendan)

Tracking

Trunk
mozilla1.8beta4
Points:
---
Bug Flags:
blocking1.8b5 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

14 years ago
Even though it tries using the calling context's error reporter, the DOM's
NS_ScriptErrorReporter will fail and bail out early for want of an nsJSContext
private data record for the cx -- see the XXX comment at the top.

This should be easy to fix.  Patch in a bit.

/be
(Assignee)

Comment 1

14 years ago
Created attachment 189848 [details] [diff] [review]
proposed fix

I fixed another bug: the gratuitous GC from JS_DestroyContext after each and
every evalInSandbox, which was bloating up compile time horribly.

/be
Attachment #189848 - Flags: superreview?(shaver)
Attachment #189848 - Flags: review?(shaver)
(Assignee)

Comment 2

14 years ago
This may matter a lot to GreaseMonkey.

/be
Status: NEW → ASSIGNED
Flags: blocking1.8b4+
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta4
(Assignee)

Comment 3

14 years ago
dbradley, feel free to r+ if you are around.

/be
Comment on attachment 189848 [details] [diff] [review]
proposed fix

Triple-stamping=shaver.
Attachment #189848 - Flags: superreview?(shaver)
Attachment #189848 - Flags: superreview+
Attachment #189848 - Flags: review?(shaver)
Attachment #189848 - Flags: review+
Attachment #189848 - Flags: approval1.8b4+
(Assignee)

Comment 5

14 years ago
Fixed.  Could justify this on branches at some point, but not clear it would
make GreaseMonkey's (or anyone else's) life simpler, given downrev 1.0.x clients
in the field that would need a workaround (which we have, I worked it out with
Aaron on IRC today -- don't ask!).

/be
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
The compiler complains about this code:
jsapi.c:4482: warning: control reaches end of non-void function

Can we have a return value here, please?
I just fixed that, sorry for missing it on review.
You need to log in before you can comment on or make changes to this bug.