jshint/jshint — Issue #334: jshint incorrectly over-reports non-existent errors [regression]
Author: goatslacker
Created: 2011-11-04 07:56:08+00:00
State: open

For this piece of code:

function foo() {
return
{
"foo": "bar"
};
}

I'll get these errors on HEAD

2 3 'Line breaking error \'return\'.'
2 9 'Missing semicolon.'
3 3 'Expected to see a statement and instead saw a block.'
3 3 'Expected an assignment or function call and instead saw an expression.'
3 4 'Missing semicolon.'
4 5 'Expected an assignment or function call and instead saw an expression.'
4 8 'Missing semicolon.'
4 10 'Expected \'}\' to match \'{\' from line 1 and instead saw \':\'.'
4 12 'Expected an assignment or function call and instead saw an expression.'
4 15 'Missing semicolon.'
5 3 'Expected \'(end)\' and instead saw \'}\'.'

On the website/a couple revisions back I'll get the correct version:

2 3 'Line breaking error \'return\'.'

I'm currently investigating this. Don't think it's related to the return change that was made today.