Last Comment Bug 723111 - Make it easier to completely unwrap an object
: Make it easier to completely unwrap an object
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla13
Assigned To: Blake Kaplan (:mrbkap)
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-01 07:41 PST by Blake Kaplan (:mrbkap)
Modified: 2012-02-03 11:41 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (9.17 KB, patch)
2012-02-01 07:41 PST, Blake Kaplan (:mrbkap)
bzbarsky: review+
philringnalda: checkin-
Details | Diff | Splinter Review
Updated patch (9.91 KB, patch)
2012-02-01 12:13 PST, Blake Kaplan (:mrbkap)
mrbkap: review+
mrbkap: checkin+
Details | Diff | Splinter Review

Description Blake Kaplan (:mrbkap) 2012-02-01 07:41:24 PST
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.
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2012-02-01 08:30:45 PST
Comment on attachment 593445 [details] [diff] [review]
patch

r=me
Comment 3 Phil Ringnalda (:philor) 2012-02-01 10:27:02 PST
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.
Comment 4 Blake Kaplan (:mrbkap) 2012-02-01 12:13:38 PST
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.
Comment 5 Blake Kaplan (:mrbkap) 2012-02-02 07:32:47 PST
Comment on attachment 593555 [details] [diff] [review]
Updated patch

https://hg.mozilla.org/integration/mozilla-inbound/rev/1cbc1a15094e
Comment 6 Ed Morley [:emorley] 2012-02-03 11:41:25 PST
https://hg.mozilla.org/mozilla-central/rev/1cbc1a15094e

Note You need to log in before you can comment on or make changes to this bug.