Closed Bug 476967 Opened 14 years ago Closed 14 years ago

Strict warning "assignment to undeclared variable" does not work in browser (works in js shell)

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: mrbkap)

Details

(Keywords: fixed1.9.1, regression)

Attachments

(1 file, 1 obsolete file)

This warning is pretty important for finding potential compatibility bugs in Firefox, extensions, and Greasemonkey scripts.  mrbkap explained to me why it doesn't work in the browser and has ideas about how to make it work again.
Summary: "assignment to undeclared variable" does not work in browser (works in js shell) → Strict warning "assignment to undeclared variable" does not work in browser (works in js shell)
Attached patch Proposed fix (obsolete) — Splinter Review
I noticed that we're swallowing strict warnings right now. The check in NS_ScriptErrorReporter eagerly reports warnings that would otherwise be swallowed.
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #360842 - Flags: superreview?(jst)
Attachment #360842 - Flags: review?(jst)
Attached patch patch v2Splinter Review
It turned out that the warning *was* being correctly reported all along. We don't have to do any additional work there, just report warnings eagerly.
Attachment #360842 - Attachment is obsolete: true
Attachment #361390 - Flags: superreview?(jst)
Attachment #361390 - Flags: review?(jst)
Attachment #360842 - Flags: superreview?(jst)
Attachment #360842 - Flags: review?(jst)
Attachment #361390 - Flags: superreview?(jst)
Attachment #361390 - Flags: superreview+
Attachment #361390 - Flags: review?(jst)
Attachment #361390 - Flags: review+
Comment on attachment 361390 [details] [diff] [review]
patch v2

This could use some manual testing both with strict warnings enabled and not before landing...
Attachment #361390 - Flags: approval1.9.1+
http://hg.mozilla.org/mozilla-central/rev/66c6469a7c92

Note that there are a few strict warnings in chrome that are now being reported that were previously suppressed. They will need their own investigation and resolution.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/d8c62dfe544f
Keywords: fixed1.9.1
OS: Mac OS X → All
Hardware: x86 → All
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.