Replace some script->compartment() calls with script->realm()

RESOLVED FIXED in Firefox 62

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: jandem, Assigned: jandem)

Tracking

unspecified
mozilla62
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox62 fixed)

Details

Attachments

(1 attachment)

Scripts are tied to a specific realm so things like CanReuseScriptForClone need to check the realm instead of the compartment.
Comment on attachment 8985660 [details] [diff] [review]
Replace some script->compartment() calls with script->realm()

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

Good catch.  Maybe worth removing JSScript::compartment() so people naturally default to realm()?
Attachment #8985660 - Flags: review?(luke) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f1b6b50a1b9a
Replace some script->compartment() calls with script->realm(). r=luke
(In reply to Luke Wagner [:luke] from comment #2)
> Maybe worth removing JSScript::compartment() so people
> naturally default to realm()?

That might be a good idea. It's not entirely trivial though because we have some templated thing->compartment() calls..

https://searchfox.org/mozilla-central/rev/93d2b9860b3d341258c7c5dcd4e278dea544432b/js/src/gc/Tracer.cpp#152
https://hg.mozilla.org/mozilla-central/rev/f1b6b50a1b9a
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.