Closed
Bug 709622
Opened 13 years ago
Closed 13 years ago
tests with empty body should cause a JS strict warning
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla11
People
(Reporter: florian, Assigned: cdleary)
Details
Attachments
(1 file, 1 obsolete file)
5.89 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
I just wasted time today for the second time debugging a code that mysteriously didn't work because of a trailing semi-colon after a test:
if (<test>);
<code>;
<code> is unconditionally executed. I think this code should cause a JS strict warning to appear in my error console and in my terminal (I use a debug build).
Assignee | ||
Comment 1•13 years ago
|
||
Waldo, have you noticed that we do work to detect warning situations even when warnings are disabled? /me wonders how much we can win by not doing that.
Assignee: general → christopher.leary
Status: NEW → ASSIGNED
Attachment #580978 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 2•13 years ago
|
||
Update: I hooked a test into an existing strict warning test.
Attachment #580978 -
Attachment is obsolete: true
Attachment #580978 -
Flags: review?(jwalden+bmo)
Attachment #580984 -
Flags: review?(jwalden+bmo)
Comment 3•13 years ago
|
||
Comment on attachment 580984 [details] [diff] [review]
Corresponding warning.
Review of attachment 580984 [details] [diff] [review]:
-----------------------------------------------------------------
Nice. And yeah, I kind of do wonder about warnings, although I doubt it matters much usually.
Attachment #580984 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 4•13 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ac2e9f57426d
Florian, thanks for the good idea!
Target Milestone: --- → mozilla11
Reporter | ||
Comment 5•13 years ago
|
||
(In reply to Chris Leary [:cdleary] from comment #4)
> Florian, thanks for the good idea!
Thanks for acting on it so quickly! I didn't expect such a fast turnaround on a small detail like this. Now I just wish I filed this bug the first time I wasted time on such a bug instead of adding on my todo list over a year ago that I should do it someday ;).
Assignee | ||
Comment 6•13 years ago
|
||
It's definitely a crapshoot -- some ideas are easier than others and some days the most relevant developers are more highly caffeinated than others. :-)
Comment 7•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•