{"push_id":854552582,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"acaf3f70a183fe30a8ecb362defe8ba03fc5b714","before":"0d879196bab1c733f1299d2dbc470362b64c9bc6","commits":[{"sha":"acaf3f70a183fe30a8ecb362defe8ba03fc5b714","author":{"email":"a17fed27eaa842282862ff7c1b9c8395a26ac320@mikepennisi.com","name":"Mike Pennisi"},"message":"[[FIX]] Do not enable `newcap` within strict mode\n\nSince the first public release of JSLint (ca120a7), this codebase has\nautomatically enabled the `newcap` option for all strict mode code:\n\n    function use_strict() {\n        if (nexttoken.value === 'use strict') {\n            advance();\n            advance(';');\n            strict_mode = true;\n            option.newcap = true;\n            option.undef = true;\n            return true;\n        } else {\n            return false;\n        }\n    }\n\nCommit 8de8247 unified the way JSHint detects and enforces strict mode\nacross contexts. Among other modifications, it included the following\nchange:\n\n    - if (state.tokens.curr.value === \"use strict\") {\n    + if (state.isStrict()) {\n        if (!state.option[\"(explicitNewcap)\"]) {\n          state.option.newcap = true;\n        }\n        state.option.undef = true;\n      }\n\nThis change introduced a regression: it enables the `newcap` option for\nclass bodies and ES2015 module code as well.\n\nBecause ES5's strict mode and the warnings enabled by the `newcap`\noption are orthogonal (and because as a stylistic concern, the `newcap`\nis deprecated) correct the regression by relaxing the behavior for all\ncases--do not automatically enable `newcap` when entering strict mode,\nfor whatever reason.\n\nThis change is backward-compatible because it will not cause JSHint to\nproduce new warnings. It corrects undocumented and surprising behavior,\nso it should be considered a bug fix (despite the age of the bug in\nquestion).","distinct":true,"url":"https://api.github.com/repos/jshint/jshint/commits/acaf3f70a183fe30a8ecb362defe8ba03fc5b714"}]}