summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-17 13:43:07 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-17 13:43:07 (GMT)
commitba25514d1c1010d84ffdbf75331ff71596e56c99 (patch)
tree0826e54b51a0727ec823be7768d3f34fb94ed6fd
parent92daafcd4677af16d47e51ac8e0f00c554007fa0 (diff)
downloadQt-ba25514d1c1010d84ffdbf75331ff71596e56c99.zip
Qt-ba25514d1c1010d84ffdbf75331ff71596e56c99.tar.gz
Qt-ba25514d1c1010d84ffdbf75331ff71596e56c99.tar.bz2
remove unnecessary ifdefs
-rw-r--r--src/script/api/qscriptengine.cpp17
-rw-r--r--src/script/bridge/qscriptfunction.cpp6
2 files changed, 9 insertions, 14 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 207521d..eef0b5d 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2158,13 +2158,11 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
JSC::ExecState* exec = d->currentFrame;
JSC::SourceCode source = JSC::makeSource(jscProgram, jscFileName, lineNumber);
-#ifdef QT_BUILD_SCRIPT_LIB
intptr_t sourceId = source.provider()->asID();
JSC::Debugger* debugger = d->originalGlobalObject()->debugger();
exec->globalData().scriptpool->startEvaluating(source);
if (debugger)
debugger->evaluateStart(sourceId);
-#endif
exec->clearException();
JSC::DynamicGlobalObjectScope dynamicGlobalObjectScope(exec, exec->scopeChain()->globalObject());
@@ -2175,13 +2173,13 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
if (!evalNode) {
JSC::JSValue exceptionValue = JSC::Error::create(exec, JSC::SyntaxError, errorMessage, errorLine, source.provider()->asID(), 0);
exec->setException(exceptionValue);
-#ifdef QT_BUILD_SCRIPT_LIB
+
if (debugger) {
debugger->exceptionThrow(JSC::DebuggerCallFrame(exec, exceptionValue), sourceId, false);
debugger->evaluateStop(exceptionValue, sourceId);
}
exec->globalData().scriptpool->stopEvaluating(source);
-#endif
+
return d->scriptValueFromJSCValue(exceptionValue);
}
@@ -2194,29 +2192,28 @@ QScriptValue QScriptEngine::evaluate(const QString &program, const QString &file
if (d->timeoutChecker()->shouldAbort()) {
if (d->abortResult.isError())
exec->setException(d->scriptValueToJSCValue(d->abortResult));
-#ifdef QT_BUILD_SCRIPT_LIB
+
if (debugger)
debugger->evaluateStop(d->scriptValueToJSCValue(d->abortResult), sourceId);
exec->globalData().scriptpool->stopEvaluating(source);
-#endif
+
return d->abortResult;
}
if (exceptionValue) {
exec->setException(exceptionValue);
-#ifdef QT_BUILD_SCRIPT_LIB
+
if (debugger)
debugger->evaluateStop(exceptionValue, sourceId);
exec->globalData().scriptpool->stopEvaluating(source);
-#endif
+
return d->scriptValueFromJSCValue(exceptionValue);
}
-#ifdef QT_BUILD_SCRIPT_LIB
if (debugger)
debugger->evaluateStop(result, sourceId);
exec->globalData().scriptpool->stopEvaluating(source);
-#endif
+
Q_ASSERT(!exec->hadException());
return d->scriptValueFromJSCValue(result);
}
diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp
index 396a787..27ec203 100644
--- a/src/script/bridge/qscriptfunction.cpp
+++ b/src/script/bridge/qscriptfunction.cpp
@@ -81,9 +81,7 @@ FunctionWrapper::~FunctionWrapper()
JSC::ConstructType FunctionWrapper::getConstructData(JSC::ConstructData& consData)
{
consData.native.function = proxyConstruct;
-#ifdef QT_BUILD_SCRIPT_LIB
consData.native.function.doNotCallDebuggerFunctionExit();
-#endif
return JSC::ConstructTypeHost;
}
@@ -118,10 +116,10 @@ JSC::JSObject* FunctionWrapper::proxyConstruct(JSC::ExecState *exec, JSC::JSObje
QScriptContext *ctx = eng_p->contextForFrame(eng_p->currentFrame);
QScriptValue result = self->data->function(ctx, QScriptEnginePrivate::get(eng_p));
-#ifdef QT_BUILD_SCRIPT_LIB
+
if (JSC::Debugger* debugger = eng_p->originalGlobalObject()->debugger())
debugger->functionExit(QScriptValuePrivate::get(result)->jscValue, -1);
-#endif
+
if (!result.isObject())
result = ctx->thisObject();