When calling mixin in Jade, what's the difference between + and the mixin keyword?

docmentation tells us that we invoke mixin by adding the mixin keyword to the actual mixin.

 .bar mixin foo(arguments) 

But in different places I saw people calling mixin, adding a plus sign (+), for example:

 .bar +foo(arguments) 

Can anyone explain this difference since the documentation does not seem to show it. I tried both examples, and both seemed to work.

Is + abbreviation?

+4
source share
1 answer

Yes, it seems. If you look at lib/lexer.js in the Call mixin section, you will see that terms starting with + receive tokens of type call . Later in lib/parser.js call token calls parseCall to create a new mixin node call.

In addition, a commit was made with a comment:

Added preliminary support for the mixin block and a new call + mixin syntax.

+6
source

All Articles