Closed Bug 58694 Opened 24 years ago Closed 24 years ago

javascript strict warnings in filepicker.js

Categories

(Core :: XUL, defect, P3)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: grayjk, Assigned: bryner)

Details

Attachments

(3 files)

JavaScript strict warning: chrome://global/content/filepicker.js line 168: redeclaration of var j JavaScript strict warning: chrome://global/content/filepicker.js line 190: redeclaration of var ruleNode JavaScript strict warning: chrome://global/content/filepicker.js line 400: redeclaration of var i JavaScript strict warning: chrome://global/content/filepicker.js line 403: redeclaration of var i JavaScript strict warning: chrome://global/content/filepicker.js line 62: reference to undefined property o.displayDirectory.path
->bryner/future
Assignee: trudelle → bryner
Target Milestone: --- → Future
setting to mozilla 1.0 -- would be nice to fix (and I will try to get this patch checked in as a partial fix) r=bryner on jarrod gray's patch
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: Future → mozilla1.0
ben, can you sr= this patch which fixes *most* of the strict warnings?
Attached patch patch #2Splinter Review
I took a slightly more aggressive cleanup approach :) Here are the changes: - get rid of all the strict warnings - remove extraneous code copied from strres.js and update what's left to be the same as in strres.js. - change several dump()'s to debug()'s to reduce console spew Please ignore the section of the patch with: + if (filePickerMode == nsIFilePicker.modeGetFolder) + textInput.value=""; I didn't mean to include it here. jag, ben, pavlov, can you guys give me some combination of r= and sr=? :)
It looks okay, but some nits: +const nsILocalFile_CONTRACTID = "@mozilla.org/file/local;1"; that should be ALL_CAPS: +const LOCAL_FILE_CONTRACTID = "@mozilla.org/file/local;1"; Related to this, perhaps you could turn the rest of the IIDs and CONTRACTIDs into constants too? That would be the locale and stringbundle related ones. There are still some dumps left which should be debugs (the ones you added with the locale service stuff). There's a shortcut for getting a service, e.g.: localeService = Components.classes[LOCALE_SERVICE_CONTRACTID] .getService(nsILocaleService);
I left in the dump()'s which were for "real" error messages-- i.e. the ones I would not expect to see. Output like this would be very helpful for diagnosing a regression in a nightly build. I'm attaching a new patch with your other suggestions incorporated.
Attached patch patch #3Splinter Review
So you catch any exceptions, then return a null, for which we don't seem to be checking. What would happen if we wouldn't catch it, or dump something useful then throw it on (instead of returning a null)? Would filepicker not start? That would be bad (no clear feedback to the user). Not being able to get the stringbundle is rather severe, perhaps we could pop up an error dialog in those cases? However, if so desired (for fail-safe reasons?) we could fall back to some default bundle (create an object which provides the GetStringFromName function and returns something useful (in English) for those five strings). Personally, I'd rather we not start the filepicker and give some clear error feedback. r=jag on the third patch, the above comments are for another bug/discussion.
There have been cases in the past where string bundles have failed to load, we handled them there by using hardcoded strings. (So unlikely a circumstance that English is better than nothing!) Note that that failure was in the profile manager, only on Mac (a result of some weird startup condition)... and this has not been experienced anywhere else in the chrome, there are numerous places I think where we just fail messily. a=ben@netscape.com
checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
verified with build 20010126 on win2k
Status: RESOLVED → VERIFIED
sorry for the spam.... just changing the subject so that the bugs can be sorted correctly
Summary: strict warnings in filepicker.js → javascript strict warnings in filepicker.js
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: