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)

defect

Tracking

()

VERIFIED FIXED
mozilla1.9alpha1

People

(Reporter: sync2d, Assigned: mrbkap)

Details

(Keywords: verified1.8.1)

Attachments

(1 file)

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
Priority: -- → P4
Target Milestone: --- → mozilla1.9alpha
Attached patch Stupid patchSplinter Review
If there's no else clause, then we can't assume that we always hit the if clause.
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #204059 - Flags: review?(brendan)
Comment on attachment 204059 [details] [diff] [review] Stupid patch r=me, thanks! /be
Attachment #204059 - Flags: review?(brendan) → review+
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
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-317533.js,v <-- regress-317533.js initial revision: 1.1
Flags: testcase+
verified windows/linux/mac trunk
Status: RESOLVED → VERIFIED
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.

Attachment

General

Created:
Updated:
Size: