Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jul 25, 2015
  1. @nicolo-ribaudo @lukeapage

    [[DOCS]] Update `jshint.js`'s path in README.md

    nicolo-ribaudo authored lukeapage committed
Commits on Jul 19, 2015
  1. @jugglinmike
  2. @nicolo-ribaudo @jugglinmike

    [[FIX]] Report an error when a necessary semicolon is missing

    nicolo-ribaudo authored jugglinmike committed
    The `asi` option also disabled warning about missing necessary
    semicolons (e.g. semicolons between two tokens on the same line). Now,
    they are reported as errors and can't be disabled.
    
    Fixes #1327
  3. @meh-uk @lukeapage

    [[FEAT]] Support multiple files in the exclude option

    meh-uk authored lukeapage committed
    Update cli.js so that the exclude option supports multiple (comma separated) files.
  4. @jugglinmike @lukeapage

    [[TEST]] Add test for reassigning function binding

    jugglinmike authored lukeapage committed
    This warning was previously untested for function declarations.
  5. @jugglinmike @lukeapage

    [[CHORE]] Refactor internals and limit warnings

    jugglinmike authored lukeapage committed
    Defer parameter validation until after functions are parsed so that the
    process can be applied according to the strictness of the function body.
    Define this via a `validateParams` method, and do not trigger warnings
    related to variable shadowing in cases where the same code triggers an
    error.
  6. @lukeapage

    [[FIX]] report line numbers of destructured params

    lukeapage authored
    The extract to scope manager change introduced a regression where by
    destructured params did not get the right line and char due to the token
    not being passed to the scope manager.
    Fixes #2494
  7. @lukeapage

    [[FIX]] Params cannot always have the same name

    lukeapage authored
    Fix the behaviour of params to respect shadow inner or outer, which causes
    a warning and strict mode, which causes an error.
    Fixes #2492
  8. @lukeapage

    [[FIX]] default params can't reference future arg

    lukeapage authored
    Change default argument processing to error if you attempt to access a
    future argument or the argument you are assigning yourself.
    Fixes #2422
  9. @lukeapage @jugglinmike
  10. @lukeapage @jugglinmike

    [[FIX]] Classes are not hoisted

    lukeapage authored jugglinmike committed
    Classes are not hoisted and have a TDZ like let and const.
    In addition logic around when a class/function name is exposed has been
    tidied up so that function/class expressions do not have their name made
    available outside the expression.
    Fixes #1934
  11. @jugglinmike @lukeapage

    [[FIX]] Prevent regressions in bug fix

    jugglinmike authored lukeapage committed
    Explicitly re-implement the erroneous behavior corrected by the previous
    commit in order to avoid breaking changes. Tolerate
    backwards-incompatable changes in those instances where the input is
    invalid JavaScript.
  12. @jugglinmike @lukeapage

    [[FIX]] Improve support for `__proto__` identifier

    jugglinmike authored lukeapage committed
    Information about identifiers used are stored internally as properties
    of objects whose key values are the identifier value. Because of
    non-standard implementations of the `__proto__` property, input source
    code that uses it as an identifier can have inconsistent side effects
    across environments.
    
    When using an object as a lookup table, the built-in
    `Object.hasOwnProperty` is generally preferable for detecting property
    membership. Unfortunately, due to the non-standard implementations
    described above, this check has environment-specific results.
    
    An alternate approach to membership detection is coercing direct
    property references to a boolean value. This is not appropriate in cases
    where the entries may themselves be "falsey" values, but in the
    identifier lookup tables, entries are consistently object literals.
    
    This second approach yields the same results across all legacy
    environments and is also compatable with the standardized specification
    for the `__proto__` attribute (provided the table is initialized to have
    no prototype).
    
    `var o = {};`
    
                                               | Compliant | Node.js v0.10.40 | IE9   | PhantomJS v1.9
    ------------------------------------------ | --------- | ---------------- | ----- | --------------
    **Before `__proto__` assignment**          |           |                  |       |
    !!o.__proto__                              | true      | true             | false | true
    '__proto__' in o                           | true      | true             | false | true
    Object.hasOwnProperty.call(o, '__proto__') | false     | false            | false | true
    Object.keys(o).length                      | 0         | 0                | 0     | 0
    **After `__proto__` assignment**           |           |                  |       |
    !!o.__proto__                              | true      | true             | true  | true
    '__proto__' in o                           | true      | true             | true  | true
    Object.hasOwnProperty.call(o, '__proto__') | false     | false            | true  | true
    Object.keys(o).length                      | 0         | 0                | 1     | 0
    
    `var o = Object.create(null);`
    
                                               | Compliant | Node.js v0.10.40 | IE9   | PhantomJS v1.9
    ------------------------------------------ | --------- | ---------------- | ----- | --------------
    **Before `__proto__` assignment**          |           |                  |       |
    !!o.__proto__                              | false     | false            | false | false
    '__proto__' in o                           | false     | true             | false | true
    Object.hasOwnProperty.call(o, '__proto__') | false     | false            | false | true
    Object.keys(o).length                      | 0         | 0                | 0     | 0
    **After `__proto__` assignment**           |           |                  |       |
    !!o.__proto__                              | true      | true             | true  | true
    '__proto__' in o                           | true      | true             | true  | true
    Object.hasOwnProperty.call(o, '__proto__') | true      | false            | true  | true
    Object.keys(o).length                      | 1         | 0                | 1     | 0
    
    Compliant enviroments: latest SpiderMonkey (and Firefox), latest V8 (and
    Chrome), Node.js v0.12.7, Iojs v.2.3.4
    
    Update all lookup tables to be created without a prototype, and update
    all membership tests to simply coerce direct attribute references.
  13. @jugglinmike @lukeapage

    [[FIX]] Relax restriction on `module` option

    jugglinmike authored lukeapage committed
    While the `module` option is intended to be set before executable code,
    this restriction should only be enforced when it is first enabled (and
    not with the application of every in-line directive).
Commits on Jul 18, 2015
  1. @lukeapage @jugglinmike
Commits on Jul 17, 2015
  1. @lukeapage @jugglinmike
  2. @nicolo-ribaudo @lukeapage

    [[FIX]] Correctly parse empty destructuring

    nicolo-ribaudo authored lukeapage committed
    Example:
      let {} = {};
      function x([]) {}
    
    Fixes #2513
  3. @nicolo-ribaudo @lukeapage
  4. @nicolo-ribaudo @lukeapage

    [[FIX]] Support `new.target`

    nicolo-ribaudo authored lukeapage committed
Commits on Jul 11, 2015
  1. @jugglinmike @lukeapage

    Revert "[[FIX]] Allow `__proto__` when using ES6"

    jugglinmike authored lukeapage committed
    This reverts commit 06b5764. That
    changeset changed which warnings JSHint produces for existing code,
    making it backwards-incompatable with the last release.
Commits on Jul 9, 2015
  1. @nicolo-ribaudo @lukeapage
  2. @nicolo-ribaudo @lukeapage

    [[FIX]] Correctly parse exported generators

    nicolo-ribaudo authored lukeapage committed
    Before of this patch, JSHint considered the name of expored
    generators `*`, because it was the first "thing" after `function`.
    
    Fix #2472
  3. @lukeapage @jugglinmike

    [[FIX]] Catch blocks are no longer functions

    lukeapage authored jugglinmike committed
    Catch blocks used to be functions in order to handle the exception
    parameter, but this is now handled by the scope manager.
    Fixes #2510
  4. @lukeapage @jugglinmike

    [[FIX]] Do not crash if the forin check is block

    lukeapage authored jugglinmike committed
    Stops the crash reported in gh-1920.
    Fixes #1920
  5. @lukeapage @jugglinmike

    [[FIX]] block scope vars dont redefine in blocks

    lukeapage authored jugglinmike committed
    Do give a redefinition error when a block scope declaration is inside a
    block.
    Fixes #2438
  6. @satchmorun @jugglinmike

    Support `--prereq` CLI options

    satchmorun authored jugglinmike committed
    Since [the docs][1] mention it, and it's already supported via [config][2],
    I thought I'd just pop the CLI support in.
    
    This PR make `jshint` allow specifying the `--prereq` option on the command
    line, accepting a comma-separated list of paths.
    
    Test-related notes:
    
    - Fixes the existing `testPrereq` test to check the right exit code. In its
      current incarnation, it could never fail (even when `lint` didn't pass)
    - Added 2 tests for specifying the `--prereq` options from the command line.
    
    Implementation notes:
    
    I did the simplest thing possible (just merging the CLI `prereq` options in
    with the config ones in the `run` method in `cli.js`). It's a little bit
    awkward because there are 2 paths to `lint`:
    
    1. `opts.useStdin`
    2. `!opts.useStdin`
    
    And each loads the config in a slightly different way. So the `mergeCLIPrereq`
    function has to be in 2 code paths. So, slightly awkward, but not too terrible.
    
    Fixes #1685.
    
    [1]: http://jshint.com/docs/cli
    [2]: https://github.com/jshint/jshint/blob/master/src/cli.js#L451-458
    
    Conflicts:
    
    	src/cli.js
    	tests/cli.js
Commits on Jul 5, 2015
  1. @lukeapage @jugglinmike

    [[FIX]] Dont warn twice in var redeclaration

    lukeapage authored jugglinmike committed
    When a block scoped variable is declared twice in the same scope it is a
    syntax error. If the variable is used between those declarations jshint
    should not warn about use before declared and error on re-declaration, so
    remove the use before declared warning in this case.
    
    When a function scoped variable is declared twice and used before
    2nd declaration, jshint does not warn in 2.8.0 but the scope manager
    change regressed this so it started warning twice. This fixes that
    regression.
  2. @lukeapage @jugglinmike

    [[FIX]] Change imported variables to be constants

    lukeapage authored jugglinmike committed
    As per the es6 spec, treat the variables declared via import as
    constants, meaning they cannot be re-assigned and cannot be declared
    twice.
    Fixes #2428
  3. @jugglinmike

    Merge branch 'fix-ignore'

    jugglinmike authored
  4. @jugglinmike

    [[FIX]] Do not mark `ignore` directives as special

    jugglinmike authored
    These directives can be handled by the lexer, so the directive processor
    in jshint.js does not need to be aware of their presence.
  5. @lukeapage @jugglinmike

    remove ignore from jshint

    lukeapage authored jugglinmike committed
  6. @lukeapage @jugglinmike

    Move ignore from state

    lukeapage authored jugglinmike committed
  7. @caitp @jugglinmike

    Don't delete lines following lex'd `ignore:end`. Fixes gh-1879

    caitp authored jugglinmike committed
    Previously, lines would be cleared (set to the empty string) even after `ignore:end`
    is found, if the comment was not processed first.
    
    This change performs some minor comment processing in the lexer itself in order to
    solve this problem.
    
    Closes #1879
  8. @lukeapage @jugglinmike

    [[CHORE]] Remove members variable which is unused

    lukeapage authored jugglinmike committed
    This variable is never used and looks like it was just left behind by
    mistake.
  9. @lukeapage @jugglinmike

    [[DOCS]] Add varstmt to example jshintrc

    lukeapage authored jugglinmike committed
    Fixes #2375
Something went wrong with that request. Please try again.