Closed
Bug 601239
Opened 14 years ago
Closed 14 years ago
Tabs in the "tabs" module don't support object identity comparison
Categories
(Add-on SDK Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 598981
People
(Reporter: avarma, Assigned: irakli)
References
Details
Ben Stover and Daniel Buchner both reported to me confusion about the behavior of the tabs API, in that two Tab objects that actually represent the same tab can't be compared to each other using standard JS equality (neither '==' nor '==='). I think Ben said that he did some poking around in the code and found that new Tab objects were instantiated every time a Tab object was provided by the API, which was why the comparison wasn't working.
Reporter | ||
Comment 1•14 years ago
|
||
At the very least, if we can't get object identity comparison working, it'd be nice to have an "id" property on the object or somesuch.
Comment 2•14 years ago
|
||
On the Window API I needed a way to map the high-level object wrappers back to the actual XULWindow objects, so a mix of a cache/hash was used. One of the benefits of that is that it avoids creating a wrapper more than once, as it's possible to retrieve the one that was created, which makes the objects comparable. http://github.com/mozillalabs/jetpack-sdk/blob/master/packages/addon-kit/lib/windows.js#L166
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → rFobic
Assignee | ||
Comment 3•14 years ago
|
||
I'm working on tab related stuff so I'll take care of this one as well.
Comment 4•14 years ago
|
||
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product. To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Assignee | ||
Comment 5•14 years ago
|
||
Making this a duplicate for 598981 since it includes fix for this.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•