Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.0 Beta 4
-
-
64ee4968b46019b8e4cb7523a6e41833fc4cf665 (qt/qtdeclarative/5.12.0)
Description
Ecmascript template literals are not working correctly if there are nested strings inside.
For example
`This is Text \nand this is newline`
works just fine, but
let a = 123; let b = `x ${a} \ny`; print(b);
gives an error "Expected token `(template tail)'"
However, this same javascript code seems to evaluate correctly with QJSEngine
QJSEngine jsEngine; QJSValue value = jsEngine.evaluate("let a = 123; let b = `x${a}\ny`; b;"); qDebug() << value.toString(); // prints "x123\ny"
Please find the attached example project which demonstrates this issue
Attachments
Issue Links
- relates to
-
QTCREATORBUG-21869 Syntax highlight for backtick and template literals not supported
- Closed
-
QTCREATORBUG-22474 Incorrect syntax warning in JavaScript template literal
- Closed