Closed Bug 1466112 Opened 2 years ago Closed Last year

Make sure obj->global() and obj->realm() are not called on wrappers

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: jandem, Unassigned)

References

Details

Wrappers are shared by all realms in their compartment, so asking a wrapper for its global/realm is kind of meaningless.

What we should do is:

(1) Define NativeObject::{global,realm} methods. Native objects are never wrappers so hopefully this will eliminate a good number of JSObject::{global,realm} calls.

(2) Remove JSObject::{global,realm} and replace them with either nonWrapper{Global,Realm} (with appropriate asserts) or maybeWrapper{Global,Realm}. (Same thing for ObjectGroup::realm...)

(3) This audit will also affect JSAutoRealm and various other APIs. Initially we can put these in the maybeWrapper bucket and then audit them in follow-up bugs.
Depends on: 1468137
Depends on: 1468219
Depends on: 1468252
Depends on: 1468406
Depends on: 1468752
Blocks: 1469082
Depends on: 1472973
Depends on: 1475559
Depends on: 1477921
Depends on: 1481793
Depends on: 1482082
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.