Closed Bug 953935 Opened 10 years ago Closed 10 years ago

Participants is "undefined" on trunk

Categories

(Instantbird Graveyard :: Conversation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clokep, Assigned: clokep)

Details

Attachments

(1 file)

*** Original post on bio 499 at 2010-09-12 18:41:00 UTC ***

The number of participants in a chat room is "undefined" on trunk (Mozilla2).  There are no errors in the error console.
*** Original post on bio 499 at 2010-09-12 18:49:46 UTC ***

The count is updated here:

https://hg.instantbird.org/instantbird/file/6aa4d3dd20e7/instantbird/content/conversation.xml#l729

It's using __count__ which was deprecated if I recall correctly.
*** Original post on bio 499 at 2010-09-12 18:53:59 UTC ***

Its deprecated in Gecko 2: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object#Properties_2
https://bugzilla.mozilla.org/show_bug.cgi?id=551529

Looking for a work around...
Attached patch The ES5 fixSplinter Review
*** Original post on bio 499 as attmnt 353 at 2010-09-12 19:12:00 UTC ***

According to the bug there is an "ES5" way to get # of properties of an object. I found you can use "Object.keys(someObject).length" to do it: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys

This is verified working for me
Attachment #8352095 - Flags: review?(florian)
Assignee: nobody → clokep
Status: NEW → ASSIGNED
Comment on attachment 8352095 [details] [diff] [review]
The ES5 fix

*** Original change on bio 499 attmnt 353 at 2010-09-12 20:53:31 UTC ***

Thank you so much for jumping on this and providing a good fix even before I had time to investigate the issue.
Attachment #8352095 - Flags: review?(florian) → review+
*** Original post on bio 499 at 2010-09-13 11:00:34 UTC ***

The fix was checked-in yesterday:
https://hg.instantbird.org/instantbird/rev/859eafe43f67
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
OS: Windows 7 → All
Hardware: x86 → All
*** Original post on bio 499 at 2011-04-13 15:58:39 UTC ***

Cleaning up some old bugs to add milestones.
Target Milestone: --- → 0.3a1
You need to log in before you can comment on or make changes to this bug.