[jsdbg2] Debugger.Object.prototype.evalInGlobal fails to unwrap referent

RESOLVED FIXED in mozilla19

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jimb, Assigned: jimb)

Tracking

Trunk
mozilla19
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
If the 'this' value given to Debugger.Object.prototype.evalInGlobal is a Debugger.Object referring to a global via a wrapper, evalInGlobal will complain that its 'this' is "does not refer to a global object". It should evaluate its argument using the wrapper's target as the global.
(Assignee)

Comment 1

5 years ago
Created attachment 665672 [details] [diff] [review]
Dereference wrapped 'this' referents in Debugger.Object.prototype.evalInGlobal.

Will r? when it passes try...
Assignee: general → jimb
Status: NEW → ASSIGNED
(Assignee)

Comment 2

5 years ago
Try: https://tbpl.mozilla.org/?tree=Try&rev=967ecd6113a1
(Assignee)

Comment 3

5 years ago
By the way, this patch's tests use functions added in bug 794726.
Depends on: 794726
(Assignee)

Updated

5 years ago
Attachment #665672 - Flags: review?(jorendorff)
(Assignee)

Updated

5 years ago
Blocks: 743311
Attachment #665672 - Attachment is patch: true
Comment on attachment 665672 [details] [diff] [review]
Dereference wrapped 'this' referents in Debugger.Object.prototype.evalInGlobal.

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

I think we may have agreed that evalInGlobal should to stay picky on this. r?me again if you disagree.
Attachment #665672 - Flags: review?(jorendorff)
(Assignee)

Comment 5

5 years ago
Yes, I agree it should. We should make sure the error thrown makes sense, though, so I may put a new patch to that effect here.
(Assignee)

Updated

5 years ago
No longer blocks: 743311
(Assignee)

Comment 6

5 years ago
Created attachment 669792 [details] [diff] [review]
Complain coherently when evalInGlobal{,withBindings} is passed a CCW to a global, not a global.
Attachment #665672 - Attachment is obsolete: true
(Assignee)

Comment 7

5 years ago
Try: https://tbpl.mozilla.org/?tree=Try&rev=ea525136085a

Will r? if it looks good.
(Assignee)

Comment 8

5 years ago
Try does not look good. But I am given to understand that one may expect improved results if one takes care to resolve patch conflicts before submitting one's efforts.

With great optimism:
https://tbpl.mozilla.org/?tree=Try&rev=a5eb7f21b40e
(Assignee)

Updated

5 years ago
Attachment #669792 - Flags: review?(jorendorff)

Comment 9

5 years ago
Comment on attachment 669792 [details] [diff] [review]
Complain coherently when evalInGlobal{,withBindings} is passed a CCW to a global, not a global.

Stealing at jimb's request.  Friendly error message and nice test case; r+
Attachment #669792 - Flags: review?(jorendorff) → review+
(Assignee)

Comment 10

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/f67e5b827cdf
Flags: in-testsuite+
Target Milestone: --- → mozilla19
https://hg.mozilla.org/mozilla-central/rev/f67e5b827cdf
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.