Closed Bug 384852 Opened 17 years ago Closed 9 years ago

Strict warning "does not always return a value" should only be shown once per function

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jruderman, Unassigned)

References

()

Details

(Keywords: testcase)

js> (function(s,t) { if(s) return; if(t) return 1; return 2; }) strict warning: anonymous function does not always return a value: strict warning: (function(s,t) { if(s) return; if(t) return 1; return 2; }) strict warning: .............................................^ strict warning: anonymous function does not always return a value: strict warning: (function(s,t) { if(s) return; if(t) return 1; return 2; }) strict warning: .......................................................^ One of these warnings would be sufficient; there's no reason to warn every time another return statement is encountered. It would be nice if it were more clear what the warning is complaining about. Pointing to the return that *doesn't* include a value would be an improvement.
Blocks: 296661
OS: Mac OS X → All
Hardware: x86 → 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: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.