This website requires JavaScript.
Explore
Help
Sign In
feedc0de
/
qt-creator
Watch
1
Star
0
Fork
0
You've already forked qt-creator
forked from
qt-creator/qt-creator
Code
Pull Requests
Activity
Files
901b2be036618f562ecfc3bf48be58830609bfe7
qt-creator
/
tests
/
auto
/
qml
/
reformatter
/
objectliteral.js
13 lines
170 B
JavaScript
Raw
Normal View
History
Unescape
Escape
QmlJS reformatter: Fix object literals. The comma token seems to be invalid. Change-Id: I859fa58ba0ba1e975e0cf1105c2b53aac848fb0d Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-29 14:37:36 +01:00
var
x
=
{
Qml/js reformatter: use quotes in objects literals The reformatter used to remove the quotes that wraps the property name in object literals. This causes problem when the name is not a valid identifier, resulting in that valid code become invalid after reformatting. This patch forces wrapping of property's name in quotes: in this way, the reformatted code is consistent and it never get invalidated. However the resulting formatted code is not consisted with the one formatted by previous versions. Task-number: QTCREATORBUG-17455 Change-Id: I1e361102819055de210d6c81020f204c08aaa253 Reviewed-by: Markus Maier <markus.maier.sw@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-21 10:00:44 +01:00
"x"
:
12
,
"y"
:
{
"x"
:
12
,
"y"
:
"abc"
,
"z"
:
function
(
x
)
{
QmlJS indenter: Improve indentation of function expressions. As discussed with Tor Arne and Fawzi in http://codereview.qt-project.org/#change,18080 Change-Id: Ia0482d2ed3ddd61fa002e2c76b948301af52a795 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2012-03-01 08:35:21 +01:00
return
a
}
,
Qml/js reformatter: use quotes in objects literals The reformatter used to remove the quotes that wraps the property name in object literals. This causes problem when the name is not a valid identifier, resulting in that valid code become invalid after reformatting. This patch forces wrapping of property's name in quotes: in this way, the reformatted code is consistent and it never get invalidated. However the resulting formatted code is not consisted with the one formatted by previous versions. Task-number: QTCREATORBUG-17455 Change-Id: I1e361102819055de210d6c81020f204c08aaa253 Reviewed-by: Markus Maier <markus.maier.sw@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-21 10:00:44 +01:00
"abc"
:
15
QmlJS reformatter: Fix object literals. The comma token seems to be invalid. Change-Id: I859fa58ba0ba1e975e0cf1105c2b53aac848fb0d Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-29 14:37:36 +01:00
}
,
Qml/js reformatter: use quotes in objects literals The reformatter used to remove the quotes that wraps the property name in object literals. This causes problem when the name is not a valid identifier, resulting in that valid code become invalid after reformatting. This patch forces wrapping of property's name in quotes: in this way, the reformatted code is consistent and it never get invalidated. However the resulting formatted code is not consisted with the one formatted by previous versions. Task-number: QTCREATORBUG-17455 Change-Id: I1e361102819055de210d6c81020f204c08aaa253 Reviewed-by: Markus Maier <markus.maier.sw@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-11-21 10:00:44 +01:00
"z"
:
12
QmlJS reformatter: Fix object literals. The comma token seems to be invalid. Change-Id: I859fa58ba0ba1e975e0cf1105c2b53aac848fb0d Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-29 14:37:36 +01:00
}
Copy Permalink