Create the loadSubScript function in the right compartment

RESOLVED FIXED in Firefox 18

Status

()

Firefox
Developer Tools: Debugger
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

unspecified
Firefox 20
Points:
---

Firefox Tracking Flags

(firefox18 fixed, firefox19 fixed, firefox20 fixed)

Details

Attachments

(1 attachment)

Created attachment 684116 [details] [diff] [review]
Patch

The loadSubScript function in dbg-server.jsm is imported into a sandbox and then executed to load subscripts.  Importing functions totally confuses our compartment sharing stuff we have for b2g, so those subscripts are ending up being run in the JSM scope instead of in the sandbox.  The attached patch creates the function in the sandbox so it's associated with the right scope and good things happen.

robcee, please redirect the review if you can't review this.
Attachment #684116 - Flags: review?(rcampbell)

Updated

5 years ago
Attachment #684116 - Flags: review?(rcampbell) → review+
Can you use function.toSource() instead?
function.toSource() is our extension. Standard function.toString() would be preferred.
https://hg.mozilla.org/mozilla-central/rev/532c363394cb
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Please post changeset links and set the appropriate status flags when uplifting.
https://hg.mozilla.org/releases/mozilla-aurora/rev/444a70f88360
status-firefox19: --- → fixed
status-firefox20: --- → fixed
You need to log in before you can comment on or make changes to this bug.