Closed Bug 763856 Opened 12 years ago Closed 12 years ago

Need way to leave a JSAutoEnterCompartment without waiting for the destructor to be called

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: bholley, Assigned: bholley)

Details

Attachments

(1 file, 3 obsolete files)

This has been annoying me. In general, it's great to use scoping. But sometimes, it unnecessarily complicates the code. For example, sometimes we want to leave the compartment before doing a tail function call. Currently, we have to unnecessarily brace/indent a lot of things to make this happen.

Patch coming up.
Attaching a patch, flagging luke for review.
Attachment #632171 - Flags: review?(luke)
Adding to the mess of the NodePrincipal (et al) check isn't great, but I'm refactoring that in bug 761704.
Attachment #632210 - Flags: review?(mrbkap)
Added an updated comment to clarify why two JSAutoEnterCompartments are necessary.
Attachment #632209 - Attachment is obsolete: true
Attachment #632209 - Flags: review?(mrbkap)
Attachment #632211 - Flags: review?(mrbkap)
Gah! Wrong bug number for those other patches. Sorry blake. :-(
Attachment #632210 - Attachment is obsolete: true
Attachment #632210 - Flags: review?(mrbkap)
Attachment #632211 - Attachment is obsolete: true
Attachment #632211 - Flags: review?(mrbkap)
One thing I realized about this patch is that it allows the consumer to pooch the compartment situation by leaving compartments out of order. I suspect it's not worth worrying about, but maybe we should add some asserts somehow?
Attachment #632171 - Flags: review?(luke) → review+
Pushed to m-i:
http://hg.mozilla.org/integration/mozilla-inbound/rev/f195d6de172f
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/f195d6de172f
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: