Closed Bug 281445 Opened 20 years ago Closed 19 years ago

In <editor.js>, "Warning: redeclaration of var editor"

Categories

(Core :: DOM: Editor, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: sgautherie, Assigned: sgautherie)

References

Details

Attachments

(2 files, 1 obsolete file)

[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8b) Gecko/20050207] (nightly) (W98SE)

{{
Warning: redeclaration of var editor
Source File: chrome://editor/content/editor.js
Line: 199, Column: 10
Source Code:
      var editor = GetCurrentEditor();
}}

{{
 164 jst        1.233     
 165                      if (prefName.substr(0, kUseCssPref.length) == kUseCssPref)
 166                      {
 167                        var cmd = document.getElementById("cmd_highlight");
 168                        if (cmd) {
 169                          var prefs = GetPrefs();
 170                          var useCSS = prefs.getBoolPref(prefName);
 171                          var editor = GetCurrentEditor();

 199 cmanske    1.193       var editor = GetCurrentEditor();
}}
Flags: blocking1.8b?
Target Milestone: --- → mozilla1.8beta
Attached patch (Av1-Bw) <editor.js> (obsolete) — Splinter Review
Possible additional cleanup:
I wonder if "all" |GetPrefs()| and |var prefs| could be replaced by |gPrefs| !?
Assignee: composer → gautheri
Status: NEW → ASSIGNED
Attachment #173689 - Flags: review?(daniel)
Flags: blocking1.8b? → blocking1.8b-
Comment on attachment 173689 [details] [diff] [review]
(Av1-Bw) <editor.js>

Neil:
Could you have a look at my previous comment(s), and possibly take r? and sr? ?
(This patch still applies cleanly))
Attachment #173689 - Flags: superreview?(neil)
Comment on attachment 173689 [details] [diff] [review]
(Av1-Bw) <editor.js>

>+        var useCSS = GetPrefs().getBoolPref(prefName);
Yes, this should probably use gPrefs. (I managed to use both in one patch, and you've now made me feel really stupid, but fortunately my reviewer didn't spot it either, so I'm not the only one!)

>+    else if (editor && (prefName.substr(0, kCRInParagraphsPref.length) == kCRInParagraphsPref))
This doesn't need to be substr; that was only necessary for the button preferences because editor watches all the buttons at once. Here we're only watching one pref.
Attachment #173689 - Flags: superreview?(neil) → superreview-
Attachment #173689 - Attachment is obsolete: true
Attachment #173689 - Flags: review?(daniel)
Av1-Bw, with comment 3 suggestion(s).

I kept the 3 |substr()| related to buttons, and another one...

(untested and not for checkin)
Attachment #216669 - Flags: superreview?(neil)
Attachment #216669 - Flags: review?(neil)
Attachment #216669 - Flags: superreview?(neil)
Attachment #216669 - Flags: superreview+
Attachment #216669 - Flags: review?(neil)
Attachment #216669 - Flags: review+
Same as Av2-Bw, with full diff, for checkin.
Comment on attachment 216779 [details] [diff] [review]
(Av2) <editor.js>
[Checked in: Comment 6]


Checkin: { 2006-04-04 00:59	neil%parkwaycc.co.uk 	mozilla/editor/ui/composer/content/editor.js 	1.238 }

'approval-branch-1.8.1=?':
Trivial JS code cleanup, no risk.
Attachment #216779 - Attachment description: (Av2) <editor.js> → (Av2) <editor.js> [Checked in: Comment 6]
Attachment #216779 - Flags: approval-branch-1.8.1?(asa)
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Component: Composer → Editor
Product: Mozilla Application Suite → Core
Resolution: --- → FIXED
Target Milestone: mozilla1.8beta1 → mozilla1.9alpha
Attachment #216779 - Flags: approval-branch-1.8.1?(asa) → approval-branch-1.8.1?(daniel)
Attachment #216779 - Flags: approval-branch-1.8.1?(daniel) → approval1.8.1?
Attachment #216779 - Flags: approval1.8.1? → approval1.8.1-
Not clear why this is needed on the 1.8 branch since it is just code cleanup.  Let us know if there is a functional reason you want it there.
(In reply to comment #7)
> Not clear why this is needed on the 1.8 branch since it is just code cleanup. 
> Let us know if there is a functional reason you want it there.

To make it short, it's more a matter of synchronization/optimization than of need/functionality.
Yet, what would be the reason not to have it on 1.8.1 !? (1.8.0 being left alone)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: