odoo / owl

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

[FIX] compiler: better support for arrow function and function call #1619

Closed rfr-odoo closed 3 weeks ago

rfr-odoo commented 3 weeks ago

This commit fixes inline expressions when we have these conditions:

In the compileExprToArray we have a code to handle missing tokens in an object e.g.: {a} (equivalent to {a:a})

When OWL match all 3 conditions listed above we execute the code to handle the missing tokens and so it alter the tokens and adds a new token: { type: "COLON", value: ":" } This result in a Javascript compilation error: OwlError: Failed to compile template "XXX": missing ) after argument list

To fix the error and avoid execute the code to handle the missing tokens, now, we track also the parentheses in our local stack.