From a874cf581d48b12ccc2380ede5c22da1908fff71 Mon Sep 17 00:00:00 2001 From: Marco Benelli Date: Tue, 21 Nov 2017 10:00:44 +0100 Subject: 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 Reviewed-by: Lars Knoll --- tests/auto/qml/reformatter/objectliteral.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qml/reformatter/objectliteral.js b/tests/auto/qml/reformatter/objectliteral.js index 9c8bfc46f1..37f6863374 100644 --- a/tests/auto/qml/reformatter/objectliteral.js +++ b/tests/auto/qml/reformatter/objectliteral.js @@ -1,12 +1,12 @@ var x = { - x: 12, - y: { - x: 12, - y: "abc", - z: function (x) { + "x": 12, + "y": { + "x": 12, + "y": "abc", + "z": function (x) { return a }, - abc: 15 + "abc": 15 }, - z: 12 + "z": 12 } -- cgit v1.2.1