Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.14.0
-
-
b8d99af6fd5c7831d83ddf3c820ca028ec0f9cf8 (qt-creator/qt-creator/master)
Description
Qt Creator tool for QML re-formatting (Tools > QML/JS > Reformat File) breaks on arrow functions in JS blocks.
The following input:
import QtQuick 2.15 Rectangle { Component.onCompleted: { const values = ["10", "20", "30", "40"] const result = values.map(value => parseInt(value)) } }
Gives the following output after reformatting:
import QtQuick 2.15 Rectangle { Component.onCompleted: { const values = ["10", "20", "30", "40"] const result = values.map(function value parseInt parseInt parseInt(value) )) } }
The output code is not valid and does not run. I would expect the arrow function to be preserved here.
Attachments
For Gerrit Dashboard: QTCREATORBUG-25198 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
330274,6 | qmljs: fix arrow function reformatting | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |