When calling a mixin in Jade, what's the difference between "+" and mixin keyword?
The docmentation tells us to call a Mixin by prepending the keyword
mixin to the actual mixin.
.bar mixin foo(arguments)
But on different places I saw people calling a mixin by prepending a plus (+) sign, like:
Could someone please explain the difference since the documentation does not seem to show it. I tried both examples and both seemed to work.
+ just a shorthand?
Yes, it appears so. If you look at
lib/lexer.js in the
Call mixin section, you can see that terms beginning with a
+ get tokenized with type
call. Later in
call token causes
parseCall to create a new mixin invocation node.
Furthermore the commit was made with with the comment:
Added preliminary mixin block support and the new + mixin invocation syntax.