aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4runtime.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-16 15:27:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:14:52 +0200
commit4241a5583623be758df3884c133acff2e11cd33f (patch)
treecfc16898aca7238b3bf985e893db3fb7c7a85158 /src/qml/jsruntime/qv4runtime.cpp
parent382709e14daeeb5132d6e39043b1140f251fc49b (diff)
Fix handling of empty Values
Make things consistent between 32 and 64 bit again Adjust test results after the changes Almost all uses of Value::empty() will get removed in the future, but for now this gets all our tests to pass again. Change-Id: I44784a43432e78febbdfe78115c9be2a3e3ece76 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 6fc0eaae67..2bd201e2a1 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -617,6 +617,7 @@ Returned<String> *__qmljs_convert_to_string(ExecutionContext *ctx, const ValueRe
{
switch (value->type()) {
case Value::Undefined_Type:
+ case Value::Empty_Type:
return ctx->engine->id_undefined->asReturned<String>();
case Value::Null_Type:
return ctx->engine->id_null->asReturned<String>();
@@ -969,7 +970,7 @@ ReturnedValue __qmljs_call_property(ExecutionContext *context, String *name, Cal
Scope scope(context);
Scoped<Object> baseObject(scope, callData->thisObject);
if (!baseObject) {
- if (callData->thisObject.isNullOrUndefined()) {
+ if (callData->thisObject.isNullOrUndefined() || callData->thisObject.isEmpty()) {
QString message = QStringLiteral("Cannot call method '%1' of %2").arg(name->toQString()).arg(callData->thisObject.toQStringNoThrow());
context->throwTypeError(message);
}