declare variables using "var" to prevent them from leaking into the global scope #3

Merged
merged 1 commit into from Mar 7, 2012

Projects

None yet

2 participants

Contributor
fjakobs commented Feb 16, 2012

No description provided.

Owner

is this necessary? i thought node had module scope? i will pull anyway when not on mobile but it would be good to clarify this.

Contributor
fjakobs commented Feb 20, 2012

They are actually leaking. They were reported by a global variable detector in our code. Node's module scope only applied to variables declared with "var" at the top level of the file. node basically wraps each module in a function.

@teknopaul teknopaul merged commit 9fa3b12 into teknopaul:master Mar 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment