jslint - How can I ensure that all of my JavaScript functions return a value? -



jslint - How can I ensure that all of my JavaScript functions return a value? -

i've had numerous bugs happening because of missing return in function. see, when of code write in ruby, it's easy forget explicit returns.

so i'd utilize similar jslint (which use) check functions homecoming something. yes, think it's improve explicitly homecoming when it's not required hunt downwards missing returns.

so, there tools check returns? or maybe can assert in runtime in simple manner?

please don't suggest coffeescript, i'm aware of existence.

jsunit example:

<script language="javascript" src="jsunitcore.js"></script> <script language="javascript"> function testwithvalidargs() { assertequals("somefunction should homecoming something", "expected homecoming value", somefunction(2, 3)); } </script>

javascript jslint

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -