Closed
Bug 88550
Opened 23 years ago
Closed 23 years ago
javascript strict warnings in password.js
Categories
(Core Graveyard :: Security: UI, defect, P2)
Tracking
(Not tracked)
VERIFIED
FIXED
psm2.1
People
(Reporter: bugzilla, Assigned: inactive-mailbox)
Details
Attachments
(1 file)
666 bytes,
patch
|
Details | Diff | Splinter Review |
Warning: reference to undefined property window.arguments Source File: chrome://pippki/content/password.js Line: 38 Please add the following line to your prefs.js file, so we could avoid all the strict warning fixup...: user_pref("javascript.options.strict", true);
Comment 1•23 years ago
|
||
p2 t->2.1 v->2.0
Priority: -- → P2
Target Milestone: --- → 2.1
Version: 1.01 → 2.0
Assignee | ||
Comment 2•23 years ago
|
||
I assume the the author wanted to check whether object "window" has a property named "arguments". I'm not a JavaScript expert, and couldn't find a documentation on how to do it, but in many places spread all over the Mozilla JavaScript sources, the if ("property" in object) notation is used, and changing the code this way makes the warning message go away. Therefore I'm suggesting the attached patch to fix the problem.
Assignee | ||
Comment 3•23 years ago
|
||
Assignee | ||
Comment 4•23 years ago
|
||
David, please review.
Comment 5•23 years ago
|
||
r=ddrinan.
Comment 6•23 years ago
|
||
I'm not sure that one is correct. Isn't that just supposed to be an empty array?
Assignee | ||
Comment 7•23 years ago
|
||
My understanding is, it is not guaranteed that "window" will have a property "arguments". It could have one, but only if previous code during runtime added this property to the current window instance. I searched the existing sources and found some other occurences of similar code: ./xpfe/browser/resources/content/fastnav.js: if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { ./xpfe/browser/resources/content/fastnav.js: if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) ./xpfe/browser/resources/content/fastnav.js: if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true)./xpfe/browser/resources/content/navigator.js: if ("arguments" in window && window.arguments.length > 1 && window.arguments[1]) { ./xpfe/browser/resources/content/navigator.js: if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) ./xpfe/browser/resources/content/navigator.js: if ("arguments" in window && window.arguments.length >= 3 && window.arguments[2] == true) ./xpfe/browser/resources/content/pageInfo.js: if ("arguments" in window) { ./xpfe/browser/resources/content/viewsource.js: if ("arguments" in window && window.arguments.length >= 2) { ./xpfe/components/bookmarks/resources/addBookmark.js: if ("arguments" in window) { ./xpfe/components/bookmarks/resources/bookmarks.js: if ("arguments" in window && window.arguments[0]) { ./xpfe/components/history/resources/history.js: if ("arguments" in window && window.arguments[0] && window.arguments.length >= 1) { ./xpfe/components/prefwindow/resources/content/pref-applications-new.js: if ( "arguments" in window && window.arguments[0] ) { ./xpfe/components/prefwindow/resources/content/pref-applications-new.js: if ( "arguments" in window && window.arguments[0] ) { ./xpfe/components/prefwindow/resources/content/pref-charset.js: if ("arguments" in window && window.arguments[0]) ./xpfe/components/prefwindow/resources/content/pref-languages.js: if (!("arguments" in window)) { ./mailnews/addrbook/resources/content/abAddressBookNameDialog.js: if ("arguments" in window && window.arguments[0]) ./mailnews/addrbook/resources/content/abCardOverlay.js: if ("arguments" in window && window.arguments[0]) ./mailnews/base/resources/content/msgMail3PaneWindow.js: if ("arguments" in window && window.arguments[0]) ./mailnews/base/search/resources/content/FilterEditor.js: if ("arguments" in window && window.arguments[0]) { ./mailnews/news/resources/content/downloadheaders.js: if ("arguments" in window && window.arguments[0]) { This looks like we could deduce this code is correct. It is used to execute code accesing the property "arguments" only if the above code succeeds. Do you agree, or do you suggest we should find a JavaScript expert who could tell whether the code is correct? Do you know someone we could ask?
Comment 8•23 years ago
|
||
No, that's fine. sr=blizzard
Reporter | ||
Comment 9•23 years ago
|
||
who's up for a checkin?
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 11•23 years ago
|
||
adding nsenterprise to all P1, P2 PSM bugs with target milestone of 2.1
Keywords: nsenterprise
Reporter | ||
Comment 12•23 years ago
|
||
I'll say again: just needs checkin...
Keywords: nsenterprise,
review
Comment 14•23 years ago
|
||
Checked in patch for Kai.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•