• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jshint / jshint / 2296
100%

Build:
DEFAULT BRANCH: master
Ran 05 Nov 2015 06:30PM UTC
Jobs 2
Files 13
Run time 16s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2296

push

travis-ci

Mike Pennisi
[[FIX]] Do not enable `newcap` within strict mode

Since the first public release of JSLint (ca120a7), this codebase has
automatically enabled the `newcap` option for all strict mode code:

    function use_strict() {
        if (nexttoken.value === 'use strict') {
            advance();
            advance(';');
            strict_mode = true;
            option.newcap = true;
            option.undef = true;
            return true;
        } else {
            return false;
        }
    }

Commit 8de8247 unified the way JSHint detects and enforces strict mode
across contexts. Among other modifications, it included the following
change:

    - if (state.tokens.curr.value === "use strict") {
    + if (state.isStrict()) {
        if (!state.option["(explicitNewcap)"]) {
          state.option.newcap = true;
        }
        state.option.undef = true;
      }

This change introduced a regression: it enables the `newcap` option for
class bodies and ES2015 module code as well.

Because ES5's strict mode and the warnings enabled by the `newcap`
option are orthogonal (and because as a stylistic concern, the `newcap`
is deprecated) correct the regression by relaxing the behavior for all
cases--do not automatically enable `newcap` when entering strict mode,
for whatever reason.

This change is backward-compatible because it will not cause JSHint to
produce new warnings. It corrects undocumented and surprising behavior,
so it should be considered a bug fix (despite the age of the bug in
question).

3943 of 4043 relevant lines covered (97.53%)

6294.21 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2296.1 05 Nov 2015 06:30PM UTC 0
97.5
Travis Job 2296.1
2 2296.2 05 Nov 2015 06:30PM UTC 0
97.45
Travis Job 2296.2
Source Files on build 2296
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2296
  • acaf3f70 on github
  • Prev Build on master (#2279)
  • Next Build on master (#2298)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc