javascript - Enforcing strict mode retroactively -
i'd enforce function level strict mode (i.e. toggle strict true in project's .jshintrc) on legacy javascript project. there way aside adding "use strict"; line @ start of every single function in project?
for project (new or old) seems lot of avoidable boilerplate. how people (if @ all) typically handle it?
...aside adding "use strict"; line @ start of every single function in project?
yes, can add @ top of every file in project (this "code compilation" level); applies functions within file (code compilation unit).
this true inline script in web pages, fwiw, e.g.:
<script> "use strict"; // strict mode code function foo() { // } </script> <script> // isn't </script>
Comments
Post a Comment