bminer / node-mysql-queues

Wraps 'node-mysql' to provide mulitple query queues, allowing support for multiple statements and transactions.
MIT License
92 stars 11 forks source link

Update master #17

Closed dimatron closed 12 years ago

dimatron commented 12 years ago

"Var" declares a variable for the block in the java script {} does not limit the power.

bminer commented 12 years ago

Thanks for the pull request. What is the purpose of this change?

dimatron commented 12 years ago

within loops should not initiate the variables, errors can occur which then will be difficult to catch, the right to make any declarations to the top of the block function https://developer.mozilla.org/en/JavaScript/Reference/Statements/var

bminer commented 12 years ago

It is pretty common to see variables defined in loops or elsewhere even if their scope extends beyond the loop. The MDN article you referenced is rather opinionated about defining variables at the top of functions, but in practice, I think that it's sometimes even more confusing to do so.

I will likely not merge this change, but thank you for the pull request.