Closed Bug 679198 Opened 13 years ago Closed 13 years ago

stop using .wrappedJSObject where it isn't necessary

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: ochameau)

References

()

Details

Attachments

(1 file)

Over in bug 676572, I committed Alex's fix for a bug triggered by the SDK's use of .wrappedJSObject, about which Alex and mrbkap had the following conversation on IRC today:

alexp_: mrbkap: this choice of passing the unwrapped version to the worker API comes from the past. We mostly used the unwrapped version before. Now, we tend to use the xraywrapper in most places.
alexp_: mrbkap: this is something I may look at and modify.
mrbkap: alexp_: I'll comment in the bug, but bz was exactly right.
mrbkap: alexp_: whenever you do anything through a .wrappedJSObject all gets/sets look like they're coming from content.
mrbkap: alexp_: that's because we can't guarantee who's doing what once you've done .wrappedJSObject.
mrbkap: alexp_: since there might have been a getter or something like that.
mrbkap: alexp_: so your patch looks ok to me, but IMO it'd be better to get rid of the .wrappedJSObject.

We should audit the SDK's use of .wrappedJSObject and stop using it wherever it isn't necessary.
Adding a link to a code search for "wrappedJSObject" in whatever revision of the SDK is mirrored to hg.
Attached patch Remove themSplinter Review
Avoid unwrapping XrayWrappers until we really need it.
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Attachment #553470 - Flags: review?(rFobic)
Comment on attachment 553470 [details] [diff] [review]
Remove them

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

r+ Assuming that all tests pass!
Attachment #553470 - Flags: review?(rFobic) → review+
Landed:
https://github.com/mozilla/addon-sdk/commit/7610f7565abc98131f2d93f5717e0ef0ae0353da
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: