Open Bug 219509 Opened 22 years ago Updated 17 years ago

undeclared variable and using alert instead of the promptservice

Categories

(SeaMonkey :: MailNews: Account Configuration, defect)

defect
Not set
minor

Tracking

(Not tracked)

People

(Reporter: timeless, Unassigned)

References

Details

Attachments

(2 obsolete files)

@see bug 138302 chrome://messenger/content/AccountWizard.js line 87: assignment to undeclared variable gDefaultSpecialFolderPickerMode ###!!! ASSERTION: You are calling CreateInstance "{a2112d6a-0e28-421f-b46a-25c0b308cbd0}" when a service for this CID already exists!: 'Error', file i:/build/mozilla/xpcom/components/nsComponentManager.cpp, line 1952
Status: NEW → ASSIGNED
Summary: undeclared variable and using service as instance → undeclared variable and using alert instead of the promptservice
Attachment #131625 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 131625 [details] [diff] [review] declare variable and use the promptservice >-var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(); >-promptService = promptService.QueryInterface(Components.interfaces.nsIPromptService); >+var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService); Nit: const > // default picker mode for copies and folders >-gDefaultSpecialFolderPickerMode = "0"; >+var gDefaultSpecialFolderPickerMode = "0"; hmmm... const, really... >+var gPromptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]. >+ getService(Components.interfaces.nsIPromptService); Redeclaration, surely? >+function Alert(alertText){ >+gPromptService.alert(document.window, document.title, alertText); >+} document.window? I don't think that's defined, just use window. >- var alertText = gPrefsBundle.getString("enterName"); >- window.alert(alertText); >+ Alert(gPrefsBundle.getString("enterName")); Nice cleanup but you could rename the method and move the getString into it. What about the other aw-*.js, did you forget to diff them?
Attachment #131625 - Flags: review?(neil.parkwaycc.co.uk) → review-
Assignee: timeless → Stefan.Borggraefe
Status: ASSIGNED → NEW
The undeclared variable part of this bug is already fixed. window.alert is still used in: /mailnews/base/prefs/resources/content/aw-accname.js /mailnews/base/prefs/resources/content/aw-done.js /mailnews/base/prefs/resources/content/aw-identity.js /mailnews/base/prefs/resources/content/aw-login.js /mailnews/base/prefs/resources/content/aw-server.js
Severity: normal → minor
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Hardware: PC → All
Attached patch Patch (obsolete) — Splinter Review
This patch does the following: 1. Use promptservice instead of alert(). 2. After a failed validity check, returns the focus to the element on which the check failed. 3. Corrects all JavaScript Warnings in the Account Wizard (there were a lot).
Attachment #131625 - Attachment is obsolete: true
Attachment #145608 - Flags: review?(neil.parkwaycc.co.uk)
Blocks: 60649
Product: Browser → Seamonkey
Comment on attachment 145608 [details] [diff] [review] Patch Patch bitrotted.
Attachment #145608 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #145608 - Attachment is obsolete: true
Assignee: Stefan.Borggraefe → mail
Status: ASSIGNED → NEW
QA Contact: nbaca
Could you check what is left of this bug (and patch) ? (Now that bug 146392 is fixed.)
Depends on: 146392
AFAIK only the removal of the unused function from aw-done.js is left.
No longer blocks: 60649
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: