nsScriptLoader needn't worry so much about wrapping CompileOptions members

RESOLVED FIXED in mozilla33

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jimb, Assigned: jimb)

Tracking

unspecified
mozilla33
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

At the moment, nsScriptLoader::FillCompileOptionsForRequest takes care to properly wrap the script's owning element. However, now that bug 1031636 has landed, that's probably not necessary any more, as SpiderMonkey has taken responsibility for properly wrapping everything for the compiled code to refer to.

Try push:
https://tbpl.mozilla.org/?tree=Try&rev=5a6c1973ae64
Attachment #8449654 - Flags: review?(bzbarsky)
Comment on attachment 8449654 [details] [diff] [review]
Don't worry about the compartment of the owning element for a script's JS code.

I suspect we still need to enter _some_ compartment here; we just no longer care which one...
Attachment #8449654 - Flags: review?(bzbarsky) → review?(bobbyholley)
Comment on attachment 8449654 [details] [diff] [review]
Don't worry about the compartment of the owning element for a script's JS code.

Review of attachment 8449654 [details] [diff] [review]:
-----------------------------------------------------------------

The caller has things nicely set up with an AutoJSAPI in the proper compartment. The callee inherits that via an AutoJSContext, but it's a bit too subtle.

So let's explicitly pass the AutoJSAPI by reference to FillCompileOptionsForRequest and then grab the cx from there.

r=me with that.
Attachment #8449654 - Flags: review?(bobbyholley) → review+
New try push (just a worrywart):
https://tbpl.mozilla.org/?tree=Try&rev=252402e77376
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed419a60029c
Flags: in-testsuite-
Target Milestone: --- → mozilla33
https://hg.mozilla.org/mozilla-central/rev/ed419a60029c
Assignee: nobody → jimb
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.