diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-19 17:47:57 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-19 17:59:00 (GMT) |
commit | 7404b1124022510fb39b204c8fd0d41dc738b180 (patch) | |
tree | 335452bd15828f0ddefe3dac02d07efaaf7e6165 | |
parent | 3f9a1230e32cb43d61c8d42c9bcb2beb322f6583 (diff) | |
download | Qt-7404b1124022510fb39b204c8fd0d41dc738b180.zip Qt-7404b1124022510fb39b204c8fd0d41dc738b180.tar.gz Qt-7404b1124022510fb39b204c8fd0d41dc738b180.tar.bz2 |
Cleanups
Remove useless variable.
Use QBoolBlocker instread of custom QScript::InEval.
-rw-r--r-- | src/script/api/qscriptengine.cpp | 18 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 8 | ||||
-rw-r--r-- | src/script/bridge/qscriptqobject_p.h | 3 |
3 files changed, 5 insertions, 24 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 3556c05..0e47cde 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -788,22 +788,6 @@ static QScriptValue __setupPackage__(QScriptContext *ctx, QScriptEngine *eng) } #endif -// Helper class for stacking a script engine's inEval attribute. -class InEval -{ -public: - inline InEval(QScriptEnginePrivate *e) - : engine(e), was(e->inEval) - { - e->inEval = true; - } - inline ~InEval() - { engine->inEval = was; } -private: - QScriptEnginePrivate *engine; - bool was; -}; - } // namespace QScript QScriptEnginePrivate::QScriptEnginePrivate() @@ -2170,7 +2154,7 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file Q_D(QScriptEngine); JSC::JSLock lock(false); // ### hmmm - QScript::InEval inEval(d); + QBoolBlocker inEval(d->inEval, true); currentContext()->activationObject(); //force the creation of a context for native function; JSC::UString jscProgram = program; diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp index 8e5a844..ff88921 100644 --- a/src/script/bridge/qscriptqobject.cpp +++ b/src/script/bridge/qscriptqobject.cpp @@ -1843,7 +1843,7 @@ JSC::JSValue JSC_HOST_CALL QMetaObjectWrapperObject::call( QMetaObjectWrapperObject *self = static_cast<QMetaObjectWrapperObject*>(callee); JSC::ExecState *previousFrame = eng_p->currentFrame; eng_p->pushContext(exec, thisValue, args, callee); - JSC::JSValue result = self->execute(eng_p->currentFrame, args, /*calledAsConstructor=*/false); + JSC::JSValue result = self->execute(eng_p->currentFrame, args); eng_p->popContext(); eng_p->currentFrame = previousFrame; return result; @@ -1855,7 +1855,7 @@ JSC::JSObject* QMetaObjectWrapperObject::construct(JSC::ExecState *exec, JSC::JS QScriptEnginePrivate *eng_p = scriptEngineFromExec(exec); JSC::ExecState *previousFrame = eng_p->currentFrame; eng_p->pushContext(exec, JSC::JSValue(), args, callee, true); - JSC::JSValue result = self->execute(eng_p->currentFrame, args, /*calledAsConstructor=*/true); + JSC::JSValue result = self->execute(eng_p->currentFrame, args); eng_p->popContext(); eng_p->currentFrame = previousFrame; if (!result || !result.isObject()) @@ -1864,10 +1864,8 @@ JSC::JSObject* QMetaObjectWrapperObject::construct(JSC::ExecState *exec, JSC::JS } JSC::JSValue QMetaObjectWrapperObject::execute(JSC::ExecState *exec, - const JSC::ArgList &args, - bool calledAsConstructor) + const JSC::ArgList &args) { - Q_UNUSED(calledAsConstructor); if (data->ctor) { QScriptEnginePrivate *eng_p = QScript::scriptEngineFromExec(exec); QScriptContext *ctx = eng_p->contextForFrame(exec); diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h index c31c73e..64853ff 100644 --- a/src/script/bridge/qscriptqobject_p.h +++ b/src/script/bridge/qscriptqobject_p.h @@ -309,8 +309,7 @@ public: JSC::JSValue, const JSC::ArgList&); static JSC::JSObject* construct(JSC::ExecState *, JSC::JSObject *, const JSC::ArgList &); - JSC::JSValue execute(JSC::ExecState *exec, const JSC::ArgList &args, - bool calledAsConstructor); + JSC::JSValue execute(JSC::ExecState *exec, const JSC::ArgList &args); inline const QMetaObject *value() const { return data->value; } inline void setValue(const QMetaObject* value) { data->value = value; } |