Files
qt-creator/tests/auto/qml/reformatter/arrowFunction.qml
Fawzi Mohamed b8d99af6fd qmljs: fix arrow function reformatting
This is mainly just making sure that token that are "empty" are really
empty (to avoid writing them out in the reformatter), but still
contain the correct location (for error messages using for example
firstSourceLocation()).

Introduce a SourceLocation::zeroLength() method to make this change
simpler to do.

QtCreator does not run qlalr automatically, so it is "polluted" by the
updated generated files.

Fixes: QTCREATORBUG-25198
Change-Id: I0ab19fb380ee3d9a7d9e05d104fe313468f52703
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-03 09:52:40 +00:00

17 lines
610 B
QML

import QtQuick 2.15
Rectangle {
Component.onCompleted: {
const values = ["10", "20", "30", "40"]
const result = values.map(value => parseInt(value))
const result2 = values.map(value => parseInt(value))
const result3 = values.map(value => {
return parseInt(value)
})
const result4 = values.map((value, i) => parseInt(value) + i)
const result5 = values.map((value, i) => {
return parseInt(value) + i
})
}
}