You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Slot names are currently cascaded down the element tree to enable lazy evaluation of templates, however any inner template element whose slots share names with an outer template element will cause variable shadowing problems. The solution is lexical scoping of slot variables, so that e.g. $name in a template's content only refers to the name slot given by the definition.
Proposed implementation: in YuiTemplateDefinition's constructor, traverse the template content and replace any raw string value that confirms to a YUI script expression with a YuiLexicalExpr with a direct reference to the slots of the template definition. This way we don't actually have to parse the expressions ahead of time to determine if they contain slots, we can simply bind the unparsed expression string to the slot definitions for later evaluation.
The text was updated successfully, but these errors were encountered:
Slot names are currently cascaded down the element tree to enable lazy evaluation of templates, however any inner template element whose slots share names with an outer template element will cause variable shadowing problems. The solution is lexical scoping of slot variables, so that e.g.
$name
in a template's content only refers to the name slot given by the definition.Proposed implementation: in YuiTemplateDefinition's constructor, traverse the template content and replace any raw string value that confirms to a YUI script expression with a YuiLexicalExpr with a direct reference to the
slots
of the template definition. This way we don't actually have to parse the expressions ahead of time to determine if they contain slots, we can simply bind the unparsed expression string to the slot definitions for later evaluation.The text was updated successfully, but these errors were encountered: