diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-23 20:44:44 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-23 20:44:44 (GMT) |
commit | ac67986f156861a7e64ed80a3a23db19fba8df6a (patch) | |
tree | 26602e5314cbf73e91c78f885b1d5b583efad6ea /src/script/bridge/qscriptdeclarativeclass.cpp | |
parent | 01116bb669f072af2227fff5f9da33bc77af7256 (diff) | |
parent | 95e0e5b70b677a7468648a8ccc8d8ae553c3ca30 (diff) | |
download | Qt-ac67986f156861a7e64ed80a3a23db19fba8df6a.zip Qt-ac67986f156861a7e64ed80a3a23db19fba8df6a.tar.gz Qt-ac67986f156861a7e64ed80a3a23db19fba8df6a.tar.bz2 |
Merge remote branch 'staging/master' into bearermanagement/staging
Diffstat (limited to 'src/script/bridge/qscriptdeclarativeclass.cpp')
-rw-r--r-- | src/script/bridge/qscriptdeclarativeclass.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp index ce2fc23..1d11ede 100644 --- a/src/script/bridge/qscriptdeclarativeclass.cpp +++ b/src/script/bridge/qscriptdeclarativeclass.cpp @@ -207,25 +207,17 @@ QScriptDeclarativeClass::newObjectValue(QScriptEngine *engine, QScriptDeclarativeClass *QScriptDeclarativeClass::scriptClass(const QScriptValue &v) { QScriptValuePrivate *d = QScriptValuePrivate::get(v); - if (!d || !d->isJSC() || !d->jscValue.inherits(&QScriptObject::info)) + if (!d || !d->isJSC()) return 0; - QScriptObject *scriptObject = static_cast<QScriptObject*>(JSC::asObject(d->jscValue)); - QScriptObjectDelegate *delegate = scriptObject->delegate(); - if (!delegate || (delegate->type() != QScriptObjectDelegate::DeclarativeClassObject)) - return 0; - return static_cast<QScript::DeclarativeObjectDelegate*>(delegate)->scriptClass(); + return QScriptEnginePrivate::declarativeClass(d->jscValue); } QScriptDeclarativeClass::Object *QScriptDeclarativeClass::object(const QScriptValue &v) { QScriptValuePrivate *d = QScriptValuePrivate::get(v); - if (!d || !d->isJSC() || !d->jscValue.inherits(&QScriptObject::info)) - return 0; - QScriptObject *scriptObject = static_cast<QScriptObject*>(JSC::asObject(d->jscValue)); - QScriptObjectDelegate *delegate = scriptObject->delegate(); - if (!delegate || (delegate->type() != QScriptObjectDelegate::DeclarativeClassObject)) + if (!d || !d->isJSC()) return 0; - return static_cast<QScript::DeclarativeObjectDelegate*>(delegate)->object(); + return QScriptEnginePrivate::declarativeObject(d->jscValue); } QScriptValue QScriptDeclarativeClass::function(const QScriptValue &v, const Identifier &name) |