Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

error when using function hoisting #161

Closed
scottburch opened this Issue · 1 comment

2 participants

@scottburch

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 referenced this issue from a commit in goatslacker/jshint
@goatslacker goatslacker Fixes GH-161 issue with function hoisting b65e7bb
@goatslacker goatslacker referenced this issue from a commit in goatslacker/jshint
@goatslacker goatslacker Merge branch 'master' into GH-161 a06c81b
@goatslacker

Fixed in d17ce8d.

@goatslacker goatslacker closed this
@jugglinmike jugglinmike referenced this issue from a commit in jugglinmike/jshint
@goatslacker goatslacker Fixes GH-161 issue with function hoisting abfdfb3
@jugglinmike jugglinmike referenced this issue from a commit in jugglinmike/jshint
@goatslacker goatslacker 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
Something went wrong with that request. Please try again.