aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v8/qjsvalue_p.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-01-18 09:37:30 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-02 08:10:18 +0100
commited84a6ee63ac7a53f37efad3eb4a7e4eaa047242 (patch)
tree30fccf1b66a465a73594e74f4bda54f07e9cce5d /src/declarative/qml/v8/qjsvalue_p.h
parent4587be8097d23efe51ff46100bafad59640c10d8 (diff)
Remove invalid QJSValue type
Rationale: It's confusing to have an invalid type (which doesn't exist in JavaScript), and it creates lots of extra cases that have to be handled e.g. in value conversion and comparison. The Undefined type should be sufficient. Also, the invalid value type was being (ab)used to 1) make setProperty() act as a property deleter, and 2) signify that a property queried by property() doesn't exist. The recently introduced functions has(Own)Property() and deleteProperty() now provide that functionality. Default-constructed QJSValues now have the Undefined type. Task-number: QTBUG-23604 Change-Id: I1847492724d31e03ee1212c09ec87a2010920dc5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qjsvalue_p.h')
-rw-r--r--src/declarative/qml/v8/qjsvalue_p.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/declarative/qml/v8/qjsvalue_p.h b/src/declarative/qml/v8/qjsvalue_p.h
index fd32a14bb8..02ffc8108e 100644
--- a/src/declarative/qml/v8/qjsvalue_p.h
+++ b/src/declarative/qml/v8/qjsvalue_p.h
@@ -59,7 +59,6 @@ class QJSValuePrivate
: public QSharedData
{
public:
- inline QJSValuePrivate();
inline static QJSValuePrivate* get(const QJSValue& q);
inline static QJSValue get(const QJSValuePrivate* d);
inline static QJSValue get(QJSValuePrivate* d);
@@ -71,14 +70,14 @@ public:
inline QJSValuePrivate(uint value);
inline QJSValuePrivate(double value);
inline QJSValuePrivate(const QString& value);
- inline QJSValuePrivate(QJSValue::SpecialValue value);
+ inline QJSValuePrivate(QJSValue::SpecialValue value = QJSValue::UndefinedValue);
inline QJSValuePrivate(QV8Engine *engine, bool value);
inline QJSValuePrivate(QV8Engine *engine, int value);
inline QJSValuePrivate(QV8Engine *engine, uint value);
inline QJSValuePrivate(QV8Engine *engine, double value);
inline QJSValuePrivate(QV8Engine *engine, const QString& value);
- inline QJSValuePrivate(QV8Engine *engine, QJSValue::SpecialValue value);
+ inline QJSValuePrivate(QV8Engine *engine, QJSValue::SpecialValue value = QJSValue::UndefinedValue);
inline QJSValuePrivate(QV8Engine *engine, v8::Handle<v8::Value>);
inline void invalidate();
@@ -103,7 +102,6 @@ public:
inline bool isObject() const;
inline bool isString() const;
inline bool isUndefined() const;
- inline bool isValid() const;
inline bool isVariant() const;
inline bool isDate() const;
inline bool isRegExp() const;
@@ -149,7 +147,6 @@ private:
// Please, update class documentation when you change the enum.
enum State {
- Invalid = 0,
CString = 0x1000,
CNumber,
CBool,