Closed Bug 297799 Opened 19 years ago Closed 19 years ago

Javascript strict warning in browser.js

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
trivial

Tracking

()

VERIFIED FIXED
Firefox1.5

People

(Reporter: romain, Assigned: romain)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050614 Firefox/1.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050614 Firefox/1.0+ The first time firefox launched, try to bookmark a page generates a javascript strict warning (if "strict warnings" are enabled). Warning: assignment to undeclared variable description Source File: chrome://browser/content/browser.js Line: 1418 Reproducible: Always Steps to Reproduce: 1. Close all Firefox windows 2. Open Firefox, and go on any page 3. Try to bookmark that page 4. See in the Javascript Console the strict warning ("strict warnings" must be enabled) Actual Results: There is a JS Strict warning. Expected Results: There is not that JS Strict warning anymore.
Version: unspecified → Trunk
As I said in the other bugs, please mark all javascript strict warning bugs as blocking bug 296661.
Blocks: 296661
Assignee: nobody → r.bezut
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached patch patch (obsolete) (deleted) — Splinter Review
In the last nightly [Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050614 Firefox/1.0+], the line is 1392 which is concerned, not 1418 as I have written above. Gavin: You didn't let me enought time to do that :)
Attachment #186344 - Flags: review?(mconnor)
Comment on attachment 186344 [details] [diff] [review] patch You can do it when filing, so I assumed you had forgotten. Also, could you patch with -up8 instead of just -u? It makes it easier to review. >Index: browser/base/content/browser.js > try { > title = aDocShell.document.title || url; > charSet = aDocShell.document.characterSet; >- description = BookmarksUtils.getDescriptionFromDocument(aDocShell.document); >+ var description = BookmarksUtils.getDescriptionFromDocument(aDocShell.document); > } The other vars used there were declared just above that block (this is where the -8 comes in handy), so you should probably either declare them all up front, to be consistent. And doesn't http://lxr.mozilla.org/mozilla/source/browser/base/content/browser.js#1527 cause the same strict warning?
Attachment #186344 - Attachment is obsolete: true
Attachment #186344 - Flags: review?(mconnor)
Attached patch patch v2 (deleted) — Splinter Review
Attachment #186379 - Flags: review?(mconnor)
Attachment #186379 - Flags: review?(mconnor) → review+
Attachment #186379 - Flags: approval-aviary1.1a2?
Attachment #186379 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Whiteboard: [checkin needed][a+]
Comment on attachment 186379 [details] [diff] [review] patch v2 needs re-approbal.
Attachment #186379 - Flags: approval-aviary1.1a2+ → approval-aviary1.1a2?
Comment on attachment 186379 [details] [diff] [review] patch v2 a=bsmedberg, please land expeditiously
Attachment #186379 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Checking in browser.js; /cvsroot/mozilla/browser/base/content/browser.js,v <-- browser.js new revision: 1.449; previous revision: 1.448 done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed][a+]
Target Milestone: --- → Firefox1.1
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: