Closed Bug 347683 Opened 18 years ago Closed 18 years ago

strict warnings

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: csthomas, Assigned: csthomas)

References

Details

Attachments

(2 files, 1 obsolete file)

JavaScript strict warning: chrome://browser/content/browser.js, line 6646: trailing comma is not legal in ECMA-262 object initializers
JavaScript strict warning: chrome://browser/content/places/toolbar.xml, line 623: function TBV_DO_onDragStart does not always return a value
return a value consistently, and remove spurious commas
Attachment #232475 - Flags: review?(mconnor)
Status: NEW → ASSIGNED
Component: General → Places
QA Contact: general → places
Attached patch fix another one (obsolete) — Splinter Review
When dropping a tab after the last tab, the old code resulted in an out-of-bounds array access.  Using .item() avoids the warning and returns null more cleanly.
Attachment #232476 - Flags: review?(mconnor)
Component: Places → General
QA Contact: places → general
(In reply to comment #2)
> Created an attachment (id=232476) [edit]
> fix another one
> 
> When dropping a tab after the last tab, the old code resulted in an
> out-of-bounds array access.  Using .item() avoids the warning and returns null
> more cleanly.

This one affects the 1.8 branch, too. Might want to request approval1.8.1 on it (couldn't hurt!). :)
I'm not entirely certain [] and .item() aren't synonymous, and if I'm right this looks like a bug.
(In reply to comment #4)
>I'm not entirely certain [] and .item() aren't synonymous, and if I'm right
>this looks like a bug.
FYI foo[a] is roughly equivalent to
0 <= a && a < foo.length ? foo.item(a) : (report_strict_warning(), undefined);
Whiteboard: [cst: r?]
Comment on attachment 232475 [details] [diff] [review]
patch [checked in]

Trying a different reviewer.
Attachment #232475 - Flags: review?(mconnor) → review?(mano)
Attachment #232476 - Flags: review?(mconnor) → review?(mano)
Comment on attachment 232476 [details] [diff] [review]
fix another one

If there's an out-of-bounds issue here, let's fix that instead.
Attachment #232476 - Flags: review?(mano) → review-
Comment on attachment 232475 [details] [diff] [review]
patch [checked in]

r=mano
Attachment #232475 - Flags: review?(mano) → review+
Attachment #232475 - Attachment description: patch → patch [checked in]
Added comment explaining why you need to use .item so nobody "cleans up" this code in the future.
Attachment #232476 - Attachment is obsolete: true
Attachment #243144 - Flags: review?(mano)
Comment on attachment 243144 [details] [diff] [review]
fix another one, with comment explaining why this is correct [checked in]

ok, r=mano.
Attachment #243144 - Flags: review?(mano) → review+
Attachment #243144 - Attachment description: fix another one, with comment explaining why this is correct → fix another one, with comment explaining why this is correct [checked in]
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [cst: r?]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: