aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-13 09:08:41 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 14:26:09 +0200
commit5c4c9123917fb411598807cd9bb855b9aa1fa832 (patch)
tree7b6b35a69ba0821fb38494dda277ee981925239a /src/qml/compiler/qv4compileddata.cpp
parent3ec5aae38e77d370d1a23efe4b924ee4762a2238 (diff)
Cleanup: Fold CompiledData::Value into CompiledData::Binding
Value isn't needed anywhere else Change-Id: Ib12d85332a6096e6232a790a7e6fd63961329e3b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index bdc5c885c9..2c128280fe 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -156,6 +156,24 @@ void CompilationUnit::markObjects()
runtimeFunctions[i]->mark();
}
+QString Binding::valueAsString(const Unit *unit) const
+{
+ switch (type) {
+ case Type_Script:
+ case Type_String:
+ return unit->stringAt(stringIndex);
+ case Type_Boolean:
+ return value.b ? QStringLiteral("true") : QStringLiteral("false");
+ case Type_Number:
+ return QString::number(value.d);
+ case Type_Invalid:
+ return QString();
+ default:
+ break;
+ }
+ return QString();
+}
+
}
}