diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-17 18:16:35 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 21198a676128a52e892557bc434035bcd1ddfaac (patch) | |
tree | 10b165b797a7723507b8da375444549a5420e1e8 /src/qml/jsruntime/qv4runtime.cpp | |
parent | e441692b0b8f8fffdfdfa8a21c570adcd5cbae7a (diff) |
Don't use Value::emptyValue() anymore.
emptyValue is special and reserved for usage inside the
engine to mark missing values. The main to use cases
are when converting property descriptors, and to mark
holes in array data.
Change-Id: I0ed357e65102b1041bf9a878e6e9a4ae0657523b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4runtime.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 446ea9df3a..f440ade430 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -616,8 +616,9 @@ Returned<Object> *__qmljs_convert_to_object(ExecutionContext *ctx, const ValueRe Returned<String> *__qmljs_convert_to_string(ExecutionContext *ctx, const ValueRef value) { switch (value->type()) { - case Value::Undefined_Type: case Value::Empty_Type: + Q_ASSERT(!"empty Value encountered"); + case Value::Undefined_Type: return ctx->engine->id_undefined->asReturned<String>(); case Value::Null_Type: return ctx->engine->id_null->asReturned<String>(); @@ -970,7 +971,8 @@ ReturnedValue __qmljs_call_property(ExecutionContext *context, String *name, Cal Scope scope(context); Scoped<Object> baseObject(scope, callData->thisObject); if (!baseObject) { - if (callData->thisObject.isNullOrUndefined() || callData->thisObject.isEmpty()) { + Q_ASSERT(!callData->thisObject.isEmpty()); + if (callData->thisObject.isNullOrUndefined()) { QString message = QStringLiteral("Cannot call method '%1' of %2").arg(name->toQString()).arg(callData->thisObject.toQStringNoThrow()); context->throwTypeError(message); } |