diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2010-07-07 08:24:53 (GMT) |
---|---|---|
committer | Kent Hansen <kent.hansen@nokia.com> | 2010-07-07 08:27:29 (GMT) |
commit | 1350f26569a4ab802ba93dc23e5dcb964a0cd3a5 (patch) | |
tree | 486c414e229c4e212bb3b4532a981060b93ddfe5 /src/script | |
parent | 401a6552f2601e5ca5b2e00a274baa6dcd83c96e (diff) | |
download | Qt-1350f26569a4ab802ba93dc23e5dcb964a0cd3a5.zip Qt-1350f26569a4ab802ba93dc23e5dcb964a0cd3a5.tar.gz Qt-1350f26569a4ab802ba93dc23e5dcb964a0cd3a5.tar.bz2 |
Add missing API shims
There were still a couple of functions that didn't have them. This
could cause said functions to crash if multiple script engines were
being used.
Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 451d1b0..f6390bb 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1268,6 +1268,7 @@ QDateTime QScriptValue::toDateTime() const Q_D(const QScriptValue); if (!d || !d->engine) return QDateTime(); + QScript::APIShim shim(d->engine); return QScriptEnginePrivate::toDateTime(d->engine->currentFrame, d->jscValue); } @@ -1284,6 +1285,7 @@ QRegExp QScriptValue::toRegExp() const Q_D(const QScriptValue); if (!d || !d->engine) return QRegExp(); + QScript::APIShim shim(d->engine); return QScriptEnginePrivate::toRegExp(d->engine->currentFrame, d->jscValue); } #endif // QT_NO_REGEXP @@ -1303,6 +1305,7 @@ QObject *QScriptValue::toQObject() const Q_D(const QScriptValue); if (!d || !d->engine) return 0; + QScript::APIShim shim(d->engine); return QScriptEnginePrivate::toQObject(d->engine->currentFrame, d->jscValue); } @@ -1317,6 +1320,7 @@ const QMetaObject *QScriptValue::toQMetaObject() const Q_D(const QScriptValue); if (!d || !d->engine) return 0; + QScript::APIShim shim(d->engine); return QScriptEnginePrivate::toQMetaObject(d->engine->currentFrame, d->jscValue); } @@ -1407,6 +1411,7 @@ QScriptValue QScriptValue::property(quint32 arrayIndex, Q_D(const QScriptValue); if (!d || !d->isObject()) return QScriptValue(); + QScript::APIShim shim(d->engine); return d->engine->scriptValueFromJSCValue(d->property(arrayIndex, mode)); } @@ -1434,6 +1439,7 @@ void QScriptValue::setProperty(quint32 arrayIndex, const QScriptValue &value, "cannot set value created in a different engine"); return; } + QScript::APIShim shim(d->engine); JSC::JSValue jsValue = d->engine->scriptValueToJSCValue(value); d->setProperty(arrayIndex, jsValue, flags); } |