Skip to content
Commits on Sep 3, 2012
  1. @valueof

    Fixed a bug where new max* options were not recognized.

    So while publishing r11 I noticed that new max* options (maxparams,
    etc.) were not recognized when set using JSHint comments. That was
    because we forgot to update the code that checks for numeric values.
    This patch fixes that and adds a regression test (just in case).
    
    Will have to move r11 pointer to this commit instead of previous one.
    valueof committed Sep 3, 2012
  2. @valueof

    Better support for catch blocks.

    In JavaScript, 'catch' blocks should have their own scope--just like
    functions--but we used to treat them as an ordinary blocks meaning
    that their scope was combined with the outer function (or global).
    
    This patch changes that by treating catch blocks as anon functions
    with a special property '(catch)' that is 'true' only for catch
    blocks. This allows us to detect undefined variables better than
    before (see GH-247).
    
    In IE, however, variables from the catch scope can leak into the
    outer scope. We catch one such example (GH-618):
    
      var e = 2;
    
      try {
        throw 'boom';
      } catch (e) {
        // JSHint now warns that 'e' might get overwritten in IE.
      }
    
      console.log(e + 2); // 'boom2' instead of 4
    
    Naturally, in 'node' environment this warning disappears.
    
    Closes GH-618.
    valueof committed Sep 2, 2012
  3. @valueof

    Break early when { is not followed by a number.

    When parsing regular expressions and encountering a '{' that is
    not followed by a number there is absolutely no reason to continue
    parsing it as if there was a number.
    
    Closes GH-538.
    valueof committed Sep 2, 2012
  4. @valueof

    Make our parser to be smarter about /= and regexs.

    The ridiculously long regular expression that produces tokens was
    confused about differences between '/=' and regular expressions that
    start with '='. Basically it didn't know that the latter exist.
    
    This patch fixes the problem using the simplest (but still dumb)
    solution. It makes sure that the token for /= is not followed by
    non-whitespace characters and '/[gim]'. I hope this will catch
    most regular expressions out there.
    
    Closes GH-536.
    valueof committed Sep 2, 2012
  5. @valueof
Commits on Sep 2, 2012
  1. @valueof

    Added JSON2 and Lodash to the regression library.

    I decided that we need more code samples for regressions to be
    confident that we don't break stuff while pushing new changes. So
    I added Lodash and JSON2 to our regression library.
    
    Also I combined individual test files into one file.
    
    Closes GH-632.
    valueof committed Sep 2, 2012
Commits on Aug 29, 2012
  1. @valueof

    Don't warn about "<\!--"

    In order to not get into trouble with the HTML parser, the strings
    such as "<!--" need to be escaped. In such cases escaping '!' is
    totally valid.
    
    Closes GH-499
    valueof committed Aug 29, 2012
  2. @valueof

    Add Blob to the list of browser globals

    Blob is a part of FileSystem API and since we already have FileReader
    in the list of browser globals why not add Blob? This global exists
    on my Firefox Beta (15).
    
    Closes GH-541.
    valueof committed Aug 29, 2012
  3. @valueof

    Don't warn about insecure ^ when regexp is set.

    This option was supposed to be only about insecure '.' and lots of
    people seem to thnk that warning about ^ is unwarranted.
    
    Closes GH-555.
    valueof committed Aug 29, 2012
  4. @valueof

    Don't warn when Object is used as a function.

    Like Boolean, Number, and String, Object can be called as a function,
    which provides scripts with access to ECMAScript's internal ToObject
    logic. If passed an object, return it. If passed a primitive, return
    a new Number, Boolean, or String as appropriate (or new Object for
    null/undefined). This is useful primarily when implementing shims for
    new ECMAScript functionality that is specified to use the ToObject
    internal method.
    
    Closes GH-392.
    valueof committed Aug 29, 2012
  5. @valueof

    Make NaN a built-in global and not a reserved word.

    NaN is not a reserved word according to the ES5 spec and treating it
    like one prohibits the use of (equally valid) Number.NaN.
    
    Relevant:
    
      * List of ES5 reserved words: http://es5.github.com/#x7.6.1
      * Closes GH-286
    valueof committed Aug 29, 2012
  6. @Shutnik @valueof

    Don't warn about uncapitalized global functions used as constructors.

    This prevents JSHint from warning about the following case:
    
        var myFunc = function () {};
        var obj = new myFunc();
    
    There is not much harm in calling a normal function with 'new'.
    Shutnik committed with valueof Aug 28, 2012
  7. @valueof

    Merge branch 'master' of git://github.com/TheJosh/jshint into internal

    Merging this patch with one change (aside from conflict resolution): no
    more formal parameter to define a scope. The scope is now defined with
    a value option 'scope'. This option is undocumented and will possibly go
    away in Next. Still better than another formal parameter that we can't
    easily take away.
    
    Conflicts:
    	jshint.js
    valueof committed Aug 28, 2012
  8. @valueof

    Fix broken tests.

    My commit--56700fc43c43ecae9a7de7d5b6f3b984814f87e0--broke tests because
    I forgot to update tests/unit/envs.js and add DOMEvent into members list
    of jshint.js.
    
    Oops.
    valueof committed Aug 28, 2012
Commits on Aug 28, 2012
  1. @valueof

    Updated a list of globals for MooTools.

    Apparently, it is supposed to be Asset and not Assets. We also forgot
    DOMEvent global.
    
    Closes GH-623.
    valueof committed Aug 28, 2012
  2. @valueof

    Merge branch 'master' of git://github.com/shybyte/jshint into shybyte…

    …-master
    
    Resolved conflicts, fixed a typo in the complexity warning, removed
    word 'cyclomatic' from functions and variables (I thought it was
    redundant) and made some minor styling changes.
    
    Conflicts:
    	jshint.js
    	tests/unit/options.js
    valueof committed Aug 27, 2012
Commits on Aug 25, 2012
  1. @valueof

    Merge pull request #627 from rwldrn/626

    Adds Map, Set, WeakMap: standard, members and envs tests. Fixes GH-626
    
    Note: These globals are from ES6, not ES5.
    valueof committed Aug 24, 2012
Commits on Aug 24, 2012
  1. @rwaldron
Commits on Aug 20, 2012
  1. @valueof

    Add a shim for Array.prototype.indexOf

    Apparently, whatever JavaScript engine WSH uses, it doesn't support
    Array.prototype.indexOf method so I had to add a shim for it. I took
    the original version from MDN and modified it to pass our lint tests.
    
    Closes GH-617.
    valueof committed Aug 20, 2012
Commits on Aug 19, 2012
  1. @valueof

    Don't generate false positives on /* inside comments.

    JSHint used to attempt to detect nested multiline comments but
    that generated too many false positives:
    
        /**
         * To use bla.js provide path: bla("./*");
         */
    
    In addition to that, nested multiline comments will error early
    no matter what so there is no need for JSHint to warn about them:
    
        /*
         * /* Nested comment */
         */
    
    So I just removed that check.
    
    References:
    
    Closes GH-540
    Closes GH-599
    valueof committed Aug 19, 2012
Commits on Aug 17, 2012
  1. @valueof

    Add support for labeled and lonely blocks.

    This patch adds support for labeled and lonely blocks which
    are valid according to ECMA-262. The following cases are
    tested and supported:
    
        aLabeledBlock:
        {
            // Labeled block
        }
    
        {
            // Unlabeled block
        }
    
    This fix also prevents the parser from halting when errors
    are present in statements after which a block is expected (e.g.
    if-statements).
    
    For example, the following will report error, but not halt parsing
    with `Expected '(end)' and instead saw '}'.` which it did before,
    due to the first { not being taken in to account, and the
    bracket-matching would fail:
    
        if (a < b); {
            // Bad if-statement
        }
    
    Issues:
    
    Closes GH-603.
    
    Squashed commit of the following:
    
    commit 2eb909c1e20f3e581b0cf520c6cf9ede5620adf8
    Merge: 38fe2c9 d211d34
    Author: Anton Kovalyov <anton@kovalyov.net>
    Date:   Thu Aug 16 21:32:42 2012 -0700
    
        Merge branch 'master' of git://github.com/CarlEkerot/jshint into CarlEkerot-master
    
    commit d211d34
    Merge: f5ea569 a1d7a7d
    Author: CarlEkerot <carl.ekerot@lunicore.se>
    Date:   Mon Aug 13 10:16:10 2012 +0200
    
        Merge remote branch 'upstream/master'
    
    commit f5ea569
    Author: CarlEkerot <carl.ekerot@lunicore.se>
    Date:   Thu Aug 2 08:41:44 2012 +0200
    
        Added assertions to ensure that code execution procedes after lonely blocks, and that start-bracket errors doesn't halt the parsing.
    
    commit 2d65d8a
    Merge: 8d4f985 03c8ee6
    Author: CarlEkerot <carl.ekerot@lunicore.se>
    Date:   Wed Aug 1 11:53:39 2012 +0200
    
        Merge branch 'master' of https://github.com/CarlEkerot/jshint
    
    commit 8d4f985
    Author: CarlEkerot <carl.ekerot@lunicore.se>
    Date:   Wed Aug 1 11:13:21 2012 +0200
    
        Removed commented addError-calls in parser.js.
    
    commit e608f03
    Author: CarlEkerot <carl.ekerot@lunicore.se>
    Date:   Wed Aug 1 11:04:19 2012 +0200
    
        Fix for issue #565. Makes blocks a special case of statements. This fix also prevents jshint from crashing due to unmatched curly-brackets in many cases (such as 'expected {, was (end)' in tests/unit/fixtures/comma.js)
    
    commit 03c8ee6
    Author: Carl Ekerot <kalle@implode.se>
    Date:   Wed Aug 1 11:13:21 2012 +0200
    
        Removed commented addError-calls in parser.js.
    
    commit 7550336
    Author: Carl Ekerot <kalle@implode.se>
    Date:   Wed Aug 1 11:04:19 2012 +0200
    
        Fix for issue #565. Makes blocks a special case of statements. This fix also prevents jshint from crashing due to unmatched curly-brackets in many cases (such as 'expected {, was (end)' in tests/unit/fixtures/comma.js)
    Carl Ekerot committed with valueof Aug 16, 2012
  2. @goatslacker @valueof

    Allow excluding globals

    If I want to allow browser but I don't want anyone to use setInterval,
    for example, you should be allowed to do this.
    
    This allows the following syntax:
    
        /*jshint undef: true */
        /*global -event */
    
        event.hello(); // Warning
    
    And:
    
        JSHINT('event.hello()', {
            browser: true,
            predefs: ['-event']
        }) === false;
    
    Tickets:
    
        Closes GH-566
        Closes GH-562
    
    Squashed commit of the following:
    
    commit db51992aff1023a760d691d299214d9c711eb3ad
    Merge: 21ba612 ca001d8
    Author: Anton Kovalyov <anton@kovalyov.net>
    Date:   Thu Aug 16 21:01:42 2012 -0700
    
        Merge branch 'gh-562-3' of git://github.com/goatslacker/jshint into goatslacker-gh-562-3
    
        Conflicts:
        	jshint.js
        	tests/unit/options.js
    
    commit ca001d8
    Author: Josh Perez <josh@goatslacker.com>
    Date:   Tue Jun 26 20:14:58 2012 -0700
    
        Adds exclusion syntax to predefs in options
    
    commit 0041ccb
    Author: Josh Perez <josh@goatslacker.com>
    Date:   Tue Jun 26 20:08:51 2012 -0700
    
        Adds exclude function to global directive
    goatslacker committed with valueof Aug 16, 2012
Commits on Aug 16, 2012
  1. @valueof

    Don't enable newcap for strict mode if it was explicitly disabled.

    JSHint turns on 'newcap' for strict mode because there accessing
    unbound 'this' throws an error. However, if someone explicitly
    turned off 'newcap' we shouldn't force it back. Just assume that
    the person tweaking these option knows better.
    
    Closes GH-438.
    valueof committed Aug 15, 2012
  2. @valueof

    Add support for parens outside of IIFE.

    This patch simply removes a nitpicking warning about whether one
    should put parens on the inside of IIFE or the outside.
    
    Closes GH-470
    valueof committed Aug 15, 2012
  3. @valueof

    Make 'unused' check smarter about unused arguments.

    This patch modifies 'unused' checks so that they ignore arguments
    that were never used but that were followed by used arguments. For
    example:
    
        function one(a, b) {
            return b;
        }
    
    In this example, since unused 'a' is followed by used 'b', JSHint
    assumes that this is a backwards compatibility issue or a specific
    API pattern and suppresses the warning.
    
    But this example, on the other hand, will generate a warning for 'b'
    because there is no reason to keep it around:
    
        function one(a, b) {
            return a;
        }
    
    References:
    
        Closes GH-607
    valueof committed Aug 15, 2012
  4. @valueof

    Make JSHINT.data().unused be consistent with option.unused

    JSHINT.data().unused is a legacy array that were kind of broken.
    Lots of warnings were pointing to the parent function and generated
    lots of false positives.
    
    This patch makes option.unused to populate that array meaning
    that JSHINT.errors and JSHINT.data().unused will have the same data
    when it comes to unused variables.
    
    This patch removes one property from JSHINT.data().unused so
    scripts may break.
    
    Fixes GH-610.
    valueof committed Aug 15, 2012
  5. @valueof

    Set default value for 'lines' on each run.

    JSHint has a lot of state variables that are shared between runs.
    We need to re-assign default values to some of them on each run
    so that they don't screw up anything.
    
    One particular bug (GH-615) happened because 'warning' needed
    a variable named 'lines' that was not defined yet. Tests didn't
    catch that bug because there 'lines' was defined in previous
    test cases (no isolation in our testing framework whatsoever).
    
    Fixes GH-615.
    valueof committed Aug 15, 2012
Commits on Aug 13, 2012
  1. @valueof

    Merge pull request #608 from goatslacker/char

    Fix character positions.
    
    This patch fixes character positions reported by JSHint
    in its warnings. Useful for fixmyjs and other programs
    that rely on such data.
    valueof committed Aug 12, 2012
Commits on Aug 8, 2012
  1. @valueof

    Remove mention of JSHINT.report()

    We removed JSHINT.report() in f74fc32
    but forgot to kill it from the docs.
    valueof committed Aug 8, 2012
  2. @valueof

    Merge pull request #609 from amire80/master

    It makes sense to have our license in the README as well as in the main file.
    valueof committed Aug 8, 2012
Commits on Aug 7, 2012
  1. @amire80

    Add the license to README

    The license for this software was hidden in the comment of the JS
    file. It should be easier to find, so I put it in the README.
    amire80 committed Aug 7, 2012
  2. @goatslacker
  3. @goatslacker
  4. @goatslacker
  5. @goatslacker
Something went wrong with that request. Please try again.