Closed
Bug 58694
Opened 24 years ago
Closed 24 years ago
javascript strict warnings in filepicker.js
Categories
(Core :: XUL, defect, P3)
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: grayjk, Assigned: bryner)
Details
Attachments
(3 files)
1.36 KB,
patch
|
Details | Diff | Splinter Review | |
11.15 KB,
patch
|
Details | Diff | Splinter Review | |
11.23 KB,
patch
|
Details | Diff | Splinter Review |
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
Reporter | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
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
Assignee | ||
Comment 4•24 years ago
|
||
ben, can you sr= this patch which fixes *most* of the strict warnings?
Assignee | ||
Comment 5•24 years ago
|
||
Assignee | ||
Comment 6•24 years ago
|
||
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=? :)
Comment 7•24 years ago
|
||
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);
Assignee | ||
Comment 8•24 years ago
|
||
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.
Assignee | ||
Comment 9•24 years ago
|
||
Comment 10•24 years ago
|
||
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.
Comment 11•24 years ago
|
||
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
Assignee | ||
Comment 12•24 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 14•23 years ago
|
||
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.
Description
•