marviq / coffee-jshint

Runs your CoffeeScript source through JSHint to check for errors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Off by one error still won't die

jonahkagan opened this issue · comments

For instance, if the only code in bad.coffee is 1 for a in b, and I run coffee-jshint bad.coffee, I get:

/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/lib-js/hint.js:46
.sourceLocation([error.line - 1, error.character - 1]), line = _ref1[0], col =
                                                                    ^
TypeError: Cannot read property '0' of undefined
    at _.chain.map.filter._ref1 (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/lib-js/hint.js:46:92)
    at Array.map (native)
    at Function._.map._.collect (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/node_modules/underscore/underscore.js:97:56)
    at _.(anonymous function) [as map] (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/node_modules/underscore/underscore.js:1073:39)
    at hint (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/lib-js/hint.js:44:35)
    at /Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/lib-js/hint.js:22:14
    at Array.map (native)
    at Function._.map._.collect (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/node_modules/underscore/underscore.js:97:56)
    at hintFiles (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/lib-js/hint.js:20:12)
    at Object.<anonymous> (/Users/jonahkagan/nvm/v0.10.15/lib/node_modules/coffee-jshint/cli.js:41:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

fixed in 08cadc7