diff options
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 7 | ||||
-rw-r--r-- | src/script/api/qscriptvalue_p.h | 6 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index edcb6ac..559d532 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -275,7 +275,7 @@ qsreal ToInteger(qsreal n) } // namespace QScript -QScriptValuePrivate::QScriptValuePrivate() : engine(this), valid(true) +QScriptValuePrivate::QScriptValuePrivate() : engine(this) { ref = 0; } @@ -2430,10 +2430,7 @@ bool QScriptValue::isQMetaObject() const bool QScriptValue::isValid() const { Q_D(const QScriptValue); - if (d) - return d->isValid(); - else - return false; + return d && (!d->isJSC() || !!d->jscValue); } /*! diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h index 71bff07..9456ace 100644 --- a/src/script/api/qscriptvalue_p.h +++ b/src/script/api/qscriptvalue_p.h @@ -139,13 +139,11 @@ public: QScriptValue property(quint32 index, int resolveMode) const; QScriptValue property(const QString &, int resolveMode) const; - bool isValid() const {return valid;} void detachEngine() { // if type is not developed in js engine there is no // need to invalidate the object if (isJSC()) { - valid = false; jscValue = JSC::JSValue(); } engine = 0; @@ -153,7 +151,7 @@ public: qint64 objectId() { - if ( (type == JSC) && (valid) && (engine) ) + if ( (type == JSC) && (engine) ) return (qint64)jscValue.asCell(); else return -1; @@ -169,8 +167,6 @@ public: QString stringValue; QBasicAtomicInt ref; - bool valid; //object is valid ? - }; |