Closed Bug 808611 Opened 12 years ago Closed 12 years ago

Reimplement valueOf shadowing protection using IDL

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(1 file)

This is a less-brittle fix to bug 793969.
Depends on: 808612
This doesn't actually depend on the wrapper caching. Not sure what I was thinking.
No longer depends on: 808612
Attachment #678381 - Flags: review?(mrbkap)
Comment on attachment 678381 [details] [diff] [review]
Move valueOf to nsIDOMLocation. v1

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

::: dom/base/nsLocation.cpp
@@ +915,5 @@
>  
> +NS_IMETHODIMP
> +nsLocation::ValueOf(nsIDOMLocation** aReturn)
> +{
> +  nsCOMPtr<nsIDOMLocation> loc(this);

loc = this
Comment on attachment 678381 [details] [diff] [review]
Move valueOf to nsIDOMLocation. v1

>-    "valueOf",              // IDX_VALUE_OF
>-        IDX_VALUE_OF                ,
Isn't it required to create an interned string early?
For example, IDX_OBJECT is not used at all other than creating an interned string.
https://mxr.mozilla.org/mozilla-central/search?string=IDX_OBJECT
(In reply to Masatoshi Kimura [:emk] from comment #4)
> Comment on attachment 678381 [details] [diff] [review]
> Move valueOf to nsIDOMLocation. v1
> 
> >-    "valueOf",              // IDX_VALUE_OF
> >-        IDX_VALUE_OF                ,
> Isn't it required to create an interned string early?
> For example, IDX_OBJECT is not used at all other than creating an interned
> string.
> https://mxr.mozilla.org/mozilla-central/search?string=IDX_OBJECT

I added those strings a few weeks ago in bug 793969, so my guess is that they're not critical.
Comment on attachment 678381 [details] [diff] [review]
Move valueOf to nsIDOMLocation. v1

Slick.
Attachment #678381 - Flags: review?(mrbkap) → review+
https://hg.mozilla.org/mozilla-central/rev/292958cd0d42

Should this have a test?
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
(In reply to Ryan VanderMeulen from comment #8)
> https://hg.mozilla.org/mozilla-central/rev/292958cd0d42
> 
> Should this have a test?

The relevant test here was checked in in bug 793969.
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: