diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-10-09 06:51:12 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-10-09 06:51:12 (GMT) |
commit | 80892f907be2f271d567d902c2b3d909b0178853 (patch) | |
tree | b965540aa9a4d09d9c378acdcfb39551d7d7d79a /src/script/api | |
parent | db1162da76f1d257ba9bfcaef574275e7430385f (diff) | |
parent | f370b5d986529155baf7d9dd95678854df4105e0 (diff) | |
download | Qt-80892f907be2f271d567d902c2b3d909b0178853.zip Qt-80892f907be2f271d567d902c2b3d909b0178853.tar.gz Qt-80892f907be2f271d567d902c2b3d909b0178853.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptengine_p.h | 16 | ||||
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 20 | ||||
-rw-r--r-- | src/script/api/qscriptvalue_p.h | 6 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index 5f31054..f1fc135 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -468,6 +468,22 @@ inline QScriptValue QScriptValuePrivate::property(const QString &name, int resol return property(JSC::Identifier(exec, name), resolveMode); } +inline void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate *engine) +{ + if (engine) + return engine->allocateScriptValuePrivate(size); + return qMalloc(size); +} + +inline void QScriptValuePrivate::operator delete(void *ptr) +{ + QScriptValuePrivate *d = reinterpret_cast<QScriptValuePrivate*>(ptr); + if (d->engine) + d->engine->freeScriptValuePrivate(d); + else + qFree(d); +} + inline void QScriptEnginePrivate::registerScriptString(QScriptStringPrivate *value) { Q_ASSERT(value->type == QScriptStringPrivate::HeapAllocated); diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 92c987c..b8340a7 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -280,7 +280,7 @@ QScriptValue QScriptValuePrivate::property(const JSC::Identifier &id, int resolv { Q_ASSERT(isObject()); JSC::ExecState *exec = engine->currentFrame; - JSC::JSObject *object = jscValue.getObject(); + JSC::JSObject *object = JSC::asObject(jscValue); JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object)); JSC::JSValue result; if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) { @@ -303,7 +303,7 @@ QScriptValue QScriptValuePrivate::property(quint32 index, int resolveMode) const { Q_ASSERT(isObject()); JSC::ExecState *exec = engine->currentFrame; - JSC::JSObject *object = jscValue.getObject(); + JSC::JSObject *object = JSC::asObject(jscValue); JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object)); JSC::JSValue result; if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, index, slot)) { @@ -466,22 +466,6 @@ void QScriptValuePrivate::detachFromEngine() engine = 0; } -void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate *engine) -{ - if (engine) - return engine->allocateScriptValuePrivate(size); - return qMalloc(size); -} - -void QScriptValuePrivate::operator delete(void *ptr) -{ - QScriptValuePrivate *d = reinterpret_cast<QScriptValuePrivate*>(ptr); - if (d->engine) - d->engine->freeScriptValuePrivate(d); - else - qFree(d); -} - /*! \internal */ diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h index 6cbda97..77b5084 100644 --- a/src/script/api/qscriptvalue_p.h +++ b/src/script/api/qscriptvalue_p.h @@ -66,10 +66,10 @@ class QScriptEnginePrivate; class QScriptValue; class QScriptValuePrivate { - Q_DISABLE_COPY(QScriptValuePrivate); + Q_DISABLE_COPY(QScriptValuePrivate) public: - void* operator new(size_t, QScriptEnginePrivate*); - void operator delete(void*); + inline void* operator new(size_t, QScriptEnginePrivate*); + inline void operator delete(void*); enum Type { JavaScriptCore, |