Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

error when using function hoisting #161

Closed
scottburch opened this Issue May 16, 2011 · 1 comment

Comments

Projects
None yet
2 participants

The following will give the error "Inner functions should be listed at the top of the outer function."

Can we have an option to turn off this check? It looks pretty straight forward in the code. I noticed that another ticket was put in for something similar (using functions before they are defined) and that became the default behavior. Shouldn't This should probably fall under the same principal?

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

console.log(foo().bar());

@goatslacker goatslacker added a commit to goatslacker/jshint that referenced this issue Jan 8, 2012

@goatslacker goatslacker Fixes GH-161 issue with function hoisting b65e7bb

@goatslacker goatslacker added a commit to goatslacker/jshint that referenced this issue Jan 9, 2012

@goatslacker goatslacker Merge branch 'master' into GH-161 a06c81b
Member

goatslacker commented Jan 9, 2012

Fixed in d17ce8d.

@goatslacker goatslacker closed this Jan 9, 2012

@jugglinmike jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

@goatslacker @jugglinmike goatslacker + jugglinmike Fixes GH-161 issue with function hoisting abfdfb3

@jugglinmike jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

@goatslacker @jugglinmike goatslacker + jugglinmike Merge branch 'master' into GH-161 87134a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment