Permalink
Browse files

Merge pull request #5 from dandorman/missing_local_in_functions

added missing `local` in functions.lua
  • Loading branch information...
kikito committed Apr 30, 2012
2 parents 4a76abc + 4654f20 commit ef482f19045c6a48e4414ed04ec2415c877d215d
Showing with 2 additions and 2 deletions.
  1. +1 −1 missions/functions.lua
  2. +1 −1 src/functions.lua
View
@@ -117,7 +117,7 @@ end
function test_parenthesis_are_not_needed_on_invocation_when_the_only_parameter_is_a_string()
local function count_spaces(str)
- count = 0
+ local count = 0
str:gsub(" ", function() count = count + 1 end) -- notice the closure here!
return count
end
View
@@ -117,7 +117,7 @@ end
function test_parenthesis_are_not_needed_on_invocation_when_the_only_parameter_is_a_string()
local function count_spaces(str)
- count = 0
+ local count = 0
str:gsub(" ", function() count = count + 1 end) -- notice the closure here!
return count
end

0 comments on commit ef482f1

Please sign in to comment.