Closed Bug 92437 Opened 23 years ago Closed 23 years ago

code clean up of pref-directory.js

Categories

(SeaMonkey :: MailNews: Message Display, defect, P4)

x86
Windows 2000
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: sspitzer, Assigned: srilatha)

Details

Attachments

(1 file, 1 obsolete file)

clean up gAvailDirectories[0][0] and gAvailDirectories[0][1] to be 
gAvailDirectories[0].name and gAvailDirectories[0].value

from bug #86442

instead of:

+        identityServer[j] = new Array(2);
+        identityServer[j][0] = ;
+        identityServer[j][1] = false;

do this:

identityServer[j] = {server:currentIdentity.directoryServer, deleted:false};

then, instead of doing identityServer[j][0], you can do identityServer[j].server
and instead of identityServer[j][1] you can do identityServer[j].deleted

it makes the code much more readable.  (I'm guess the boolean was 
for "deleted", I'll leave the name to you.)

I'd recommend the same thing for cleaning up code like this:

          directoriesList.label = gAvailDirectories[0][1];
          directoriesList.value = gAvailDirectories[0][0];
QA Contact: esther → yulian
Priority: -- → P4
Target Milestone: --- → mozilla1.0
Attached patch patch v1 (obsolete) — Splinter Review
Target Milestone: mozilla1.0 → mozilla0.9.8
Attached patch updated patchSplinter Review
updated the patch against the latest trunk. Also fixed one js strict warning.
Attachment #54752 - Attachment is obsolete: true
Comment on attachment 64530 [details] [diff] [review]
updated patch

looks good, sr=sspitzer

another suggestion:

change

if (gAvailDirectories.length >= 1)

to 

if (gAvailDirectories.length)
Attachment #64530 - Flags: superreview+
r=racham
I made the change 
if (gAvailDirectories.length >= 1) to 
if (gAvailDirectories.length)

Fix checked in 
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
According to Srilatha, this bug has the same fix as bug 119777.

No warning in JS Console when deleting LDAP server.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: