Closed Bug 1524752 Opened 5 years ago Closed 5 years ago

Improve the JSScript::createScriptForLazilyInterpretedFunction compartment/realm situation

Categories

(Core :: JavaScript Engine, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jandem, Assigned: jandem)

Details

Attachments

(1 file)

It has an AutoRealm because it's necessary when we're in a different realm in the same compartment.

However I think it would be nice to assert same-compartment before the AutoRealm, so callers have to do an explicit AutoRealm if they're working with cross-compartment functions.

I'll look into this next week.

Flags: needinfo?(jdemooij)
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Flags: needinfo?(jdemooij)

It seems a bit nicer/safer to require the caller to enter the correct
realm/compartment in the cross-compartment case.

Priority: -- → P1
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/39e1b87c1dec
Assert cx and function are same-compartment in JSFunction::createScriptForLazilyInterpretedFunction. r=tcampbell
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: