Commits on Jun 27, 2016
  1. [[FIX]] Correct behavior of singleGroups (#2951)

    * [[FIX]] Correct behavior of singleGroups
    The grouping operator may be necessary if the right-binding power of the
    operator preceeding the "(" token is greater than the left-binding power
    of the operator immediately following it.
    The initial implementation approximated this behavior by using the
    readily-accessible left-binding power of both operators. This heuristic
    is not always accurate, however as in the following case:
        typeof (a + b);
    Here, the necessity of the grouping operator is determined by the
    right-binding power of the `typeof` operator.
    Extend the Pratt parser to make the right-binding power available to all
    null denotation ("nud") functions. Remove an invalid unit test exposed
    by this improvement.
    * fixup! [[FIX]] Correct behavior of singleGroups
    jugglinmike committed with rwaldron Jun 27, 2016
Commits on Jun 25, 2016
  1. [[CHORE]] Update minimatch

    Version 3.0.2 of the "minimatch" module introduces a security fix
    related to regular expression parsing.
    delphiactual committed with jugglinmike Jun 18, 2016
Commits on Jun 11, 2016
  1. [[FEAT]] Error for literals on rhs of `instanceof`

    This patch adds a new error that is used when a literal is found on the
    right-hand side of the `instanceof` infix operator. A warning is used when a
    function declaration is found.
    Literals generate errors:
        x instanceof 0;
        x instanceof '';
        x instanceof null;
        x instanceof undefined;
        x instanceof {};
        x instanceof [];
        x instanceof /./;
        x instanceof ``;
    Function declarations generate warnings:
        x instanceof function() {};
        x instanceof function MyUnusableFunction() {};
    But this is okay:
        x instanceof /x/.constructor;
        x instanceof "".constructor;
    as per GH-2773
        Closes GH-2777
    ehjay committed with jugglinmike May 18, 2016
Commits on Apr 23, 2016
  1. [[DOCS]] Add thanks for former maintainers

    jugglinmike committed Apr 23, 2016
Commits on Apr 19, 2016
  1. v2.9.2

    jugglinmike committed Apr 19, 2016
  2. [[FIX]] Correct CLI's indentation offset logic

    Don't attempt to indent errors using data from other files, during
    extract with multiple files
    This change will fix the report of `col NaN` and the problem of `NaN` in
    `error.character` while checking JS code extracted from non-JS files,
    when more than one file has been passed in and their lengths don't
    The function `extractOffsets` finds the number of characters a JS block
    must be shifted to show the correct character column for an error. The
    result is an array consisting of numbers, for the block it checked and,
    `undefined` for the lines it didn't have to look at.  `` executes
    `extractOffsets` on each input file but wrongly tries to indent all the
    errors found so far, across files, using the current file's offsets.
    This commit makes sure `` only indents errors of a file against
    the offsets fetched for the same file.
    This commit also makes sure that we don't change or ruin the value of
    `error.character` unnecessarily.
    I have chosen to trust that `extractOffsets` will return an array with
    only numbers (as a result of Array.length) and falsy values, to avoid
    the unnecessary type conversion.
    A test named `usingMultipleFiles` has been introduced to cli.
    Fixes #2778
    AMoo-Miki committed with jugglinmike Feb 26, 2016
Commits on Apr 17, 2016
  1. [[TEST]] Update expected warning message

    jugglinmike committed Apr 17, 2016
  2. [[DOCS]] Correct URL

    jugglinmike committed Apr 17, 2016
Commits on Apr 3, 2016
  1. [[FIX]] Reserve `await` keyword in ES6 module code

    From the ECMAScript 2015 specification:
    > The following tokens are reserved for used as keywords in future
    > language extensions.
    >     Syntax
    >         FutureReservedWord::
    >             enum
    >             await
    > await is only treated as a FutureReservedWord when Module is the goal
    > symbol of the syntactic grammar.
    jugglinmike committed with rwaldron Apr 3, 2016
  2. [[FIX]] Emit correct token value from "module" API

    * [[TEST]] Re-factor tests for "module" API
    Separate the project's single unit test for the module API into a
    standalone file. Beyond improving test discoverability, this
    organization encapsulates new logic necessary for test hygiene (as
    described in the in-line documentation).
    * [[FIX]] Emit correct token value
    Correct a typo in the source which caused the value `undefined` to be
    emitted as the `from` property for all Identifier tokens, regardless of
    the actual character position.
    jugglinmike committed with rwaldron Apr 3, 2016
  3. [[FIX]] Account for implied closures

    Some environments wrap code in an immediately-invoked function
    expression prior to evaluation. This behavior has an effect on global
    `var` declarations. Unlike in typical JavaScript source code, such
    statements in these contexts do *not* create new entries in the
    environment record, nor do they resolve to references to the global
    binding (where defined).
    Update the logic that tracks global definitions to account for such
    environments, avoiding issuing warning W079 ("Redefinition of '{a}'.")
    which is otherwise appropriate.
    Note: a far preferable solution would involve updating JSHint's scope
    tracking mechanism to create a new entry for this implicit function
    scope. Unfortunately the legacy implementation of the environmental
    options allowed for usage scenarios that are incompatible with that
    approach (specifically: enabling the environment options after the
    source text has been partially parsed).
    jugglinmike committed with rwaldron Apr 3, 2016
  4. [[CHORE]] Remove I003

    This warning is inappropriate in cases where `esversion` has been
    globally set to a value other than `5` (e.g. in a project's `.jshintrc`
    file) and a specific file overrides this value with an in-line
    Although it is possible to detect this case while interpreting option
    values, the warning itself has minimal utility. Some users may set
    options to their default values in the interest of explicitness.
    Preventing this practice (and doing so inconsistently--only for the
    `esversion` option) adds little value.
    Remove I003 completely.
    jugglinmike committed with rwaldron Apr 3, 2016
  5. Improve contribution guidelines

    * [[DOCS]] Describe expectations for bug reports
    * [[DOCS]] Re-structure contribution guideliness
    Formalize the distinction between types of contributions to help
    contributors find the information that is relevant to their task.
    * [[DOCS]] Include guidance on feature requests
    * [[DOCS]] Remove outdate reference
    jugglinmike committed with rwaldron Apr 3, 2016
Commits on Mar 26, 2016
  1. [[FIX]] (cli - extract) lines can end with "\\r\\n", not "\\n\\r"

    Fixes gh-2825
    nicolo-ribaudo committed with jugglinmike Jan 12, 2016
Commits on Mar 23, 2016
  1. [[DOCS]] Describe location of release notes

    In an attempt to avoid confusion for those reading the release notes
    from varied locations (e.g. GitHub's "release" pages), explicitly define
    where the release notes can be found.
    jugglinmike committed Mar 23, 2016
Commits on Mar 20, 2016
  1. [[FIX]] Add CompositionEvent to browser globals

    alexeykuzmin committed with jugglinmike Mar 1, 2016
Commits on Feb 14, 2016
  1. [[FIX]] Allow parentheses around object destructuring assignment.

    Fixes gh-2775
    nicolo-ribaudo committed with jugglinmike Feb 1, 2016
  2. [[FIX]] Allow destructuring in setter parameter

    nicolo-ribaudo committed with jugglinmike Feb 3, 2016
Commits on Feb 8, 2016
  1. Merge pull request #2831 from jugglinmike/improve-bad-assign

    Improve E031, "Bad assignment."
    rwaldron committed Feb 8, 2016
  2. [[FIX]] Expand forms accepted in dstr. assignment

    Align the parser's expectations for assignment targets in destructuring
    patterns with its expectations in other assignment expressions.
    jugglinmike committed Feb 6, 2016
  3. [[FIX]] Report "Bad assignment." in destructuring

    During destructuring, the return value of the internal
    `checkLeftSideAssign` function was discarded, so JSHint would fail to
    report invalid assignment targets in that context.
    Move the reporting of Error 031 ("Bad assignment.") into the
    `checkLeftSideAssign` to enhance consistency. Improve the
    implementation of that internal function by making it aware of the rest
    operator (the previous implementation considered this form "invalid" but
    failed to report that).
    jugglinmike committed Jan 17, 2016
Commits on Jan 31, 2016
  1. [[FIX]] Improve binding power for tagged templates

    Use a more accurate value for tagged templates' binding power in order
    to ensure that the `singleGroups` option correctly permits use of the
    grouping operator where it is truly necessary.
    jugglinmike committed Jan 30, 2016
Commits on Jan 30, 2016
  1. [[FIX]] Make the 'freeze' option less strict

    Don't warn when the prototype of a local variable
    named as a native object is modified.
    Fixes gh-1600
    nicolo-ribaudo committed with jugglinmike Dec 7, 2015
  2. [[FIX]] Report character position for camelcase errors

    Character positions were not being reported when camelcase errors were detected.
    This fix will now report the character position correctly.
    Fixes #2845
    danielbarela committed with jugglinmike Jan 26, 2016
  3. [[DOCS]] Remove deprecated es5 and esnext options

    This removes the deprecated `es5` and `esnext` options from the example
    probablycorey committed with jugglinmike Jan 28, 2016
Commits on Jan 27, 2016
  1. Merge pull request #2843 from jugglinmike/2836-bad-options-4

    [[FIX]] Do not fail on valid configurations
    rwaldron committed Jan 27, 2016
Commits on Jan 26, 2016
  1. Merge branch 'let-used-before-in-two-functions'

    jugglinmike committed Jan 26, 2016
Commits on Jan 23, 2016
  1. [[CHORE]] Complete test coverage for recent fix

    In resolving a regression, the previous commit modified the way JSHint
    interprets references to variable bindings, but it did not fully test
    the new implementation. Extend the tests for the bug fix to fully assert
    its effects.
    jugglinmike committed Jan 23, 2016
  2. [[FIX]] Do not fail on valid configurations

    When interpreting configuration values for strict-mode-related options,
    do not modify user-specified values. Instead, preserve the values as
    specified and encapsulate interpretation logic into stateless helper
    methods on the `state` object.
    This pattern allows JSHint to consistently issue warnings about invalid
    configurations by ensuring that at any given time, all option values in
    the `state` object reflect values explicitly specified by the user.
    As noted in the in-line documentation, this approach required making
    explicit certain sub-optimal behaviors which were previously implicit.
    These concerns would best be addressed in a later patch, distinct from
    the regression that prompted this changeset.
    jugglinmike committed Jan 23, 2016
Commits on Jan 21, 2016
  1. [[FIX]] Don't throw E056 for vars used in two functions

    Fixes gh-2838
    nicolo-ribaudo committed Jan 21, 2016
Commits on Jan 16, 2016
  1. [[FIX]] Do not crash on invalid input

    fip renaming of comma var
    - function is now called parseComma
    - local var has be switched back to just comma
    Fixes the bug where we would overwrite the parseComma function (when
    they were both named comma)
    gtanner committed with jugglinmike Oct 13, 2015
  2. [[FIX]] Allow regex inside template literal

    Fixes gh-2791
    nicolo-ribaudo committed with jugglinmike Dec 5, 2015