Closed Bug 871255 Opened 8 years ago Closed 7 years ago

Warning 'TypeError: redeclaration of var calInstanceOf' in calUtils.js


(Calendar :: Internal Components, defect)

Not set


(Not tracked)



(Reporter: ssitter, Assigned: Fallen)



(1 file, 1 obsolete file)

> Warning: TypeError: redeclaration of var calInstanceOf
> Source file: chrome://calendar/content/calUtils.js
> Line: 438, Column: 9
> Source code:
> function calInstanceOf(aObject, aInterface) { 

Function calInstanceOf() is declared twice in calUtils.js:
One was added in the backout here:

And the other is from deprecation. I'm going to merge them together to deprecate now, but with the old implementation. Mohit can then take care of the review comments in bug 788004.
Attached patch Fix - v1 (obsolete) — Splinter Review
Assignee: nobody → philipp
Attachment #748680 - Flags: review?(ssitter)
Maybe the obsolete implementation should be removed completely? The message "Use of calInstanceOf() is deprecated and will be removed with the next release. Use cal.wrapInstance() instead." is incorrect because there exists no function wrapInstance() in the calendar code.
I can change the message slightly, but the minimum I want to see is the old function with a deprecation message, so its clear that the function will be removed in a future release. It really depends on if Mohit has time for the other bug.
Comment on attachment 748680 [details] [diff] [review]
Fix - v1

r- because the warning is incorrect. Bug 788004 is being worked on, will it take care of this problem?
Attachment #748680 - Flags: review?(ssitter) → review-
Attached patch Fix - v2Splinter Review
The patch in bug 788004 doesn't contain the fix to actually remove the duplicate function. I'd like to push both bugs as soon as the tree opens again and with bug 788004 applied, the warning message is correct again.
Attachment #748680 - Attachment is obsolete: true
Attachment #785781 - Flags: review?(ssitter)
Attachment #785781 - Flags: approval-calendar-aurora+
Comment on attachment 785781 [details] [diff] [review]
Fix - v2

Taking over review, r+ as this function is not used in Calendar code anymore and the other version has a warning message. Approval for aurora is not needed anymore as the release went without this fix.
Attachment #785781 - Flags: review?(ssitter)
Attachment #785781 - Flags: review+
Attachment #785781 - Flags: approval-calendar-aurora+
Pushed to comm-central changeset 76f711a54fd3
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.9
OS: Windows 7 → All
Hardware: x86_64 → All
Target Milestone: 2.9 → 3.0
You need to log in before you can comment on or make changes to this bug.