odoo / owl

OWL: A web framework for structured, dynamic and maintainable applications
https://odoo.github.io/owl/
Other
1.11k stars 334 forks source link

t-component + t-set-slot throws an error if it is in another t-set-slot #1558

Closed mcm-odoo closed 8 months ago

mcm-odoo commented 8 months ago

This kind of templates cannot compile:

<t t-component="comp"> <!-- t-component is not mandatory here, could be <Comp.. -->
  <t t-set-slot="does not matter">
    <t t-component="comp">
      <t t-set-slot="does not matter">CONTENT</t>
    </t>
  </t>
</t>

Playground with the error:

https://odoo.github.io/owl/playground/#eyJqcyI6ImltcG9ydCB7IENvbXBvbmVudCwgdXNlU3RhdGUsIG1vdW50IH0gZnJvbSBcIkBvZG9vL293bFwiO1xuY2xhc3MgQ29tcCBleHRlbmRzIENvbXBvbmVudCB7XG4gICAgc3RhdGljIHRlbXBsYXRlID0gXCJDb21wXCI7XG59XG5jbGFzcyBSb290IGV4dGVuZHMgQ29tcG9uZW50IHtcbiAgICBzdGF0aWMgdGVtcGxhdGUgPSBcIlJvb3RcIjtcbiAgICBzZXR1cCgpIHtcbiAgICAgICAgdGhpcy5jb21wID0gQ29tcDtcbiAgICB9XG59XG5tb3VudChSb290LCBkb2N1bWVudC5ib2R5LCB7IHRlbXBsYXRlczogVEVNUExBVEVTLCBkZXY6IHRydWUgfSk7IiwiY3NzIjoiIiwieG1sIjoiPHRlbXBsYXRlcz5cbiAgPGRpdiB0LW5hbWU9XCJDb21wXCI+XG4gICAgPHQgdC1zbG90PVwiZGVmYXVsdFwiLz5cbiAgPC9kaXY+XG4gIDx0IHQtbmFtZT1cIlJvb3RcIj5cbiAgICA8dCB0LWNvbXBvbmVudD1cImNvbXBcIj5cbiAgICAgIDx0IHQtc2V0LXNsb3Q9XCJkZWZhdWx0XCI+XG4gICAgICAgIDx0IHQtY29tcG9uZW50PVwiY29tcFwiPlxuICAgICAgICAgIDx0IHQtc2V0LXNsb3Q9XCJkZWZhdWx0XCI+XG4gICAgICAgICAgICBDT05URU5UXG4gICAgICAgICAgPC90PlxuICAgICAgICA8L3Q+XG4gICAgICA8L3Q+XG4gICAgPC90PlxuICA8L3Q+XG48L3RlbXBsYXRlcz5cbiJ9

sdegueldre commented 8 months ago

Fixed in https://github.com/odoo/owl/pull/1559