Closed Bug 329360 Opened 19 years ago Closed 19 years ago

strict javascript warning: "variable event hides argument" in calendar-alarm-dialog

Categories

(Calendar :: Internal Components, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gekacheka, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 Build Identifier: 20060303 calendar-alarm-dialog produces a strict javascript warning. Reproducible: Always Steps to Reproduce: 1. Enable strict javascript warnings Thunderbird: tools > options > advanced > config editor set "javascript.options.strict" to "true" 2. Set alarm and let alarm go off. Actual Results: Alarm dialog appears, and the following appears in javascript console: Warning: variable event hides argument Source File: chrome://calendar/content/calendar-alarm-dialog.xul Line: 1, Column: 4 Source Code: var event = document.createEvent('Events'); event.initEvent('dismiss', false, false); this.dispatchEvent(event); Expected Results: No warnings. Code is not in the xul file shown, but in an xbl file, calendar-alarm-widget.xml, for the widget that is added for each alarm that has gone off.
(patch -l -p 2 -i file.patch) Warning appears when dismissing the alarm. Since 'event' is already bound in this context, rename the var to more descriptive event name: 'dismissEvent'. Ditto for 'snoozeEvent' (currently commented out).
Comment on attachment 214019 [details] [diff] [review] rename "var event" to "var dismissEvent" Asking review, before it falls through the cracks.
Attachment #214019 - Flags: first-review?(jminta)
Comment on attachment 214019 [details] [diff] [review] rename "var event" to "var dismissEvent" r=jminta, although these probably want to be regular methods at some point
Attachment #214019 - Flags: first-review?(jminta) → first-review+
Thanks for the patch. Checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
The bugspam monkeys have struck again. They are currently chewing on default assignees for Calendar. Be afraid for your sanity!
Assignee: base → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: