Closed Bug 1468536 Opened Last year Closed Last year
Figure out what to do with Debugger
.Object .global on CCWs
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. * ...
(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.
(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?
Yes, it's a no-op in that case, so that should be fine.
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 firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/e378e29a5ebb Remove Debugger.Object.prototype.global. r=jimb
You need to log in before you can comment on or make changes to this bug.