diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-06-16 15:24:28 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-06-20 10:03:37 +0000 |
commit | 24969e19b18ea68019ae66c99982f04b2d05a9d1 (patch) | |
tree | a4939d916d301b86659d82b30e63d8b1f184ff6e /src/qml/compiler/qv4isel_moth.cpp | |
parent | b829693623f886975a3e79c2f6804a7564449977 (diff) | |
download | qtdeclarative-24969e19b18ea68019ae66c99982f04b2d05a9d1.tar.gz |
Support object literals
Change-Id: I7fc4565044caf23bec239561be4fbc020ccc2468
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r-- | src/qml/compiler/qv4isel_moth.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp index 7d62d71e98..24fbe3c680 100644 --- a/src/qml/compiler/qv4isel_moth.cpp +++ b/src/qml/compiler/qv4isel_moth.cpp @@ -1219,15 +1219,16 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Expr *result, int { int argLocation = outgoingArgumentTempStart(); - const int classId = registerJSClass(keyValuePairCount, keyValuePairs); + QVector<Compiler::JSUnitGenerator::MemberInfo> members; // Process key/value pairs first IR::ExprList *it = keyValuePairs; for (int i = 0; i < keyValuePairCount; ++i, it = it->next) { - // Skip name + QString key = *it->expr->asName()->id; it = it->next; bool isData = it->expr->asConst()->value; + members.append({ key, !isData }); it = it->next; if (IR::Const *c = it->expr->asConst()) { @@ -1254,6 +1255,8 @@ void InstructionSelection::callBuiltinDefineObjectLiteral(IR::Expr *result, int } } + const int classId = registerJSClass(members); + // Process array values uint arrayValueCount = 0; it = arrayEntries; |