Make it easier to completely unwrap an object

RESOLVED FIXED in mozilla13

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mrbkap, Assigned: mrbkap)

Tracking

unspecified
mozilla13
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 593445 [details] [diff] [review]
patch

js::UnwrapObject currently has the following behavior:

If you pass an outer window directly to it, it returns the inner window ("unwrapping" the outer).

If you pass a security wrapper to it, it will unwrap up to the outer window, but won't unwrap it. This is useful for the case where we want to peak under the security wrappers, but don't actually need the native out of the JS object.

It turns out that it'd be useful to have an API that lets us get the innermost object. This patch adds that API and uses it in the two existing places that it seems to be useful.
Attachment #593445 - Flags: review?(bzbarsky)
Comment on attachment 593445 [details] [diff] [review]
patch

r=me
Attachment #593445 - Flags: review?(bzbarsky) → review+
(Assignee)

Comment 2

5 years ago
Comment on attachment 593445 [details] [diff] [review]
patch

https://hg.mozilla.org/integration/mozilla-inbound/rev/9aac714775b9
Attachment #593445 - Flags: checkin+
Comment on attachment 593445 [details] [diff] [review]
patch

Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/d7c7ea755e54 - about 90 short of passing make check.
Attachment #593445 - Flags: checkin+ → checkin-
(Assignee)

Comment 4

5 years ago
Created attachment 593555 [details] [diff] [review]
Updated patch

Carrying forward review: I missed a use of UnwrapObject in js/src/shell/js.cpp. Everything else is the same and the fix is trivial.
Assignee: general → mrbkap
Attachment #593445 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #593555 - Flags: review+
(Assignee)

Comment 5

5 years ago
Comment on attachment 593555 [details] [diff] [review]
Updated patch

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