From 21198a676128a52e892557bc434035bcd1ddfaac Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 17 Sep 2013 18:16:35 +0200 Subject: 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 --- src/qml/jsapi/qjsvalue.cpp | 2 +- src/qml/jsapi/qjsvalue_p.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/qml/jsapi') diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 908e9a4519..6b3d15df59 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -63,7 +63,7 @@ QV4::ReturnedValue QJSValuePrivate::getValue(QV4::ExecutionEngine *e) this->engine = e; else if (this->engine != e) { qWarning("JSValue can't be reassigned to another engine."); - return QV4::Value::emptyValue().asReturnedValue(); + return QV4::Encode::undefined(); } if (value.asString() == &string) { value = QV4::Value::fromString(engine->newString(string.toQString())); diff --git a/src/qml/jsapi/qjsvalue_p.h b/src/qml/jsapi/qjsvalue_p.h index f99fed7c44..a0dfa010ab 100644 --- a/src/qml/jsapi/qjsvalue_p.h +++ b/src/qml/jsapi/qjsvalue_p.h @@ -72,8 +72,7 @@ public: QJSValuePrivate(QV4::ExecutionEngine *engine, const QV4::Value &v) : PersistentValuePrivate(v, engine) { - if (value.isEmpty()) - value = QV4::Value::undefinedValue(); + Q_ASSERT(!value.isEmpty()); } QJSValuePrivate(QV4::Object *o) : PersistentValuePrivate(QV4::Value::fromObject(o)) -- cgit v1.2.3