canjs / can-stache

Live binding handlebars templates
https://canjs.com/doc/can-stache.html
MIT License
10 stars 13 forks source link

nodeList still in can-stache? #719

Closed justinbmeyer closed 4 years ago

justinbmeyer commented 4 years ago

https://github.com/canjs/can-stache/blob/1e9dd197d3ad21999cf217532cac9853a3178f90/expressions/call.js#L99

            if(func[isViewSymbol] === true) {
                // if not a scope, we should create a scope that
                // includes the template scope
                if(!(args[0] instanceof Scope)){
                    args[0] = scope.getTemplateContext().add(args[0]);
                }
                // and include nodeLists
                args.push(helperOptions.nodeList);
            }

We don't need to pass that second argument (nodeList). I think that should be removed.

justinbmeyer commented 4 years ago

This part:

                if(!(args[0] instanceof Scope)){
                    args[0] = scope.getTemplateContext().add(args[0]);
                }

Also makes it so {{ foo(val='bar') }} always creates a new context.

matthewp commented 4 years ago

I'm updating the docs so I'll remove this reference.

matthewp commented 4 years ago

Closed by #720