It's a way to make sure that the compiled CoffeeScript has its own scope for variable names. This has benefits in terms of efficiency and simplicity (you know you the generated JavaScript won't stomp on variables used by other code). You can disable it with the --bare
(or -b
) option to the CoffeeScript compiler.
The reason for the call(this)
is just to ensure that the CoffeeScript has the same this
as the scope where it's placed, because functions don't normally inherit their this
object from the surrounding context.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…