Skip to content

Instantly share code, notes, and snippets.

@adamcameron
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcameron/9852135 to your computer and use it in GitHub Desktop.
Save adamcameron/9852135 to your computer and use it in GitHub Desktop.
Demonstrating bug in Railo
<cfscript>
numbers = [1,2,3,4]
iterations = 0
numbers.each(function(v,i){
iterations++ //unscoped
echo("#iterations#<br>")
});
echo("<hr>")
iterations = 0
numbers.each(function(v,i){
variables.iterations++ // now with scoping
echo("#iterations#<br>")
});
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment