leafo/moonscript — Issue #26: Default function value definition within class
Author: ecornell
Created: 2012-01-11 04:43:43+00:00
State: open

The first parms default value needs to by wrapped in parentheses in order to not return a moonc compile error if it is a reference to a variable.

class Test

new: =>
@v1 = '1'
@v2 = '2'

testFunc: (a =(@v1), b = @v2) =>
print a .. b

Test!\testFunc!