Closed
Bug 317533
Opened 19 years ago
Closed 19 years ago
"function does not always return a value" does not handle if-statement well
Categories
(Core :: JavaScript Engine, defect, P4)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
mozilla1.9alpha1
People
(Reporter: sync2d, Assigned: mrbkap)
Details
(Keywords: verified1.8.1)
Attachments
(1 file)
1.52 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20051122 Firefox/1.6a1
JS strict warning "function does not always return a value" does not appear
correctly if the last statement in the function is if-without-else-clause.
javascript: _options.strict=true; eval("function(x){ if(x) return x; }");
=> not warned
javascript: _options.strict=true; eval("function(x){ if(x) return x; ; }");
=> warned
Assignee | ||
Updated•19 years ago
|
Priority: -- → P4
Target Milestone: --- → mozilla1.9alpha
Assignee | ||
Comment 1•19 years ago
|
||
If there's no else clause, then we can't assume that we always hit the if clause.
Comment 2•19 years ago
|
||
Comment on attachment 204059 [details] [diff] [review]
Stupid patch
r=me, thanks!
/be
Attachment #204059 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 3•19 years ago
|
||
Fix checked into trunk. I tweaked the patch some to avoid the recursive call if we were going to ignore the result anyway.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 4•19 years ago
|
||
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-317533.js,v <-- regress-317533.js
initial revision: 1.1
Flags: testcase+
Comment 6•19 years ago
|
||
fixed by Bug 336373 on the 1.8.1 branch.
verified fixed 1.8.1 with windows/macppc/linux 20060707
Keywords: verified1.8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•