Closed Bug 355801 Opened 19 years ago Closed 10 years ago

Incorrect "does not always return a value" strict warnings

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jruderman, Unassigned)

References

Details

(Keywords: testcase)

js> options("strict") js> function() { do { return 3 } while(x) } typein:4: strict warning: anonymous function does not always return a value: [...] js> function () { return this; x; } typein:10: strict warning: anonymous function does not always return a value: [...] This warning is wrong. But perhaps it should warn about "Unreachable code" instead?
Unreachability requires more flow analysis than SpiderMonkey's monkey-sized brain is up to. The warning is meant to guide away from obvious bad practices such as the ones you show. I'm not going to WONTFIX this bug, because we may end up with enough flow analysis to make a more accurate report, but this is pretty thin as bugs go :-P. /be
Blocks: 296661
OS: Mac OS X → All
Hardware: PowerPC → All
Assignee: general → nobody
Strict warning "does not always return a value" was removed in http://hg.mozilla.org/mozilla-central/rev/a470d0cbe3fa (bug 1046964)
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.