Closed Bug 1468536 Opened 6 years ago Closed 6 years ago

Figure out what to do with Debugger.Object.global on CCWs

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(1 file)

Debugger.Object instances have a |global| property that returns the object's global, but with same-compartment realms, cross-compartment wrappers don't have a meaningful global (wrappers by shared by all realms in the compartment). See bug 1466112.

So question is what we want to happen here. Some options:

* Return |null| for D.O.global if the reference is a CCW.
* Throw an exception.
* Return a random global.
* ...
Flags: needinfo?(jimb)
(In reply to Jan de Mooij [:jandem] from comment #0)
> (wrappers by shared

*are* shared

> * Return |null| for D.O.global if the reference is a CCW.

*referent

That's what I get for filing bug reports while listening to a talk.
It seems to me that leaving behind compartment-per-global means that there really is no clear association between JSObjects (of all kinds) and globals any more. So perhaps that accessor is not meaningful.

I don't actually see the Debugger.Object.prototype.global accessor being used in devtools/server/actors. Even if it were, I'd still tend towards deleting it, because any code that uses it needs to be updated anyway.
Flags: needinfo?(jimb)
(In reply to Jim Blandy :jimb from comment #2)
> I don't actually see the Debugger.Object.prototype.global accessor being
> used in devtools/server/actors

It's used here:

https://searchfox.org/mozilla-central/rev/ed2763bea882619ccb48b0aecc54e523d2bdd2ae/devtools/server/actors/webconsole.js#1407

I *think* this is the only consumer (based on Try-servering a patch to dump the JS stack before MOZ_CRASH'ing).

What do you think about removing that ".global !== dbgWindow" check and always calling adoptDebuggeeValue?
Flags: needinfo?(jimb)
Yes, it's a no-op in that case, so that should be fine.
Flags: needinfo?(jimb)
Assignee: nobody → jdemooij
Status: NEW → ASSIGNED
Attachment #8989361 - Flags: review?(jimb)
Comment on attachment 8989361 [details] [diff] [review]
Remove Debugger.Object.prototype.global

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

Thanks!
Attachment #8989361 - Flags: review?(jimb) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e378e29a5ebb
Remove Debugger.Object.prototype.global. r=jimb
https://hg.mozilla.org/mozilla-central/rev/e378e29a5ebb
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: