summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-08-11 19:09:14 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-08-11 19:25:20 (GMT)
commit40c54d32e287b7f043dd0d94ad43c250082c7172 (patch)
tree2842628ceef1072b4bbf9234f502759e8af3ab16 /src/script/api/qscriptengine.cpp
parent2449e7fc567f8151736949032a001cf2aa2d5bb9 (diff)
downloadQt-40c54d32e287b7f043dd0d94ad43c250082c7172.zip
Qt-40c54d32e287b7f043dd0d94ad43c250082c7172.tar.gz
Qt-40c54d32e287b7f043dd0d94ad43c250082c7172.tar.bz2
Implement connection between JSC::Debugger and QScriptEngineAgent.
Complete reimplementation of QScriptEngineAgentPrivate. New QScriptEngineAgentPrivate implementation makes conversion from different JSC::Debuger types and events to corresponding QScriptEngineAgent. contextPush and contextPop events are created in QScriptEngine each time contextPush or contextPop is ordered from public API
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index cc7ead3..dfdfdac 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -44,6 +44,7 @@
#include "qnumeric.h"
#include "qscriptengine_p.h"
+#include "qscriptengineagent_p.h"
#include "qscriptcontext_p.h"
#include "qscriptstring_p.h"
#include "qscriptvalue_p.h"
@@ -2252,11 +2253,10 @@ QScriptContext *QScriptEngine::pushContext()
previousFrame, 0, argCount, 0);
QScriptContext *ctx = d->contextForFrame(d->currentFrame);
ctx->setThisObject(globalObject());
+
+ if (agent())
+ agent()->contextPush();
return ctx;
-
-#ifndef Q_SCRIPT_NO_EVENT_NOTIFY
-// notifyContextPush(); TODO
-#endif
}
/*!
@@ -2267,6 +2267,8 @@ QScriptContext *QScriptEngine::pushContext()
*/
void QScriptEngine::popContext()
{
+ if (agent())
+ agent()->contextPop();
Q_D(QScriptEngine);
if (d->currentFrame->returnPC() != 0 || d->currentFrame->codeBlock() != 0
|| d->currentFrame->returnValueRegister() != 0 || !currentContext()->parentContext()) {
@@ -2278,9 +2280,6 @@ void QScriptEngine::popContext()
d->currentFrame->scopeChain()->pop()->deref();
d->currentFrame = d->currentFrame->callerFrame();
registerFile.shrink(newEnd);
-#ifndef Q_SCRIPT_NO_EVENT_NOTIFY
-// notifyContextPop(); TODO
-#endif
}
/*!
@@ -3530,9 +3529,11 @@ QT_END_INCLUDE_NAMESPACE
*/
void QScriptEngine::setAgent(QScriptEngineAgent *agent)
{
- qWarning("QScriptEngine::setAgent() not implemented");
Q_D(QScriptEngine);
+ if (d->agent)
+ QScriptEngineAgentPrivate::get(d->agent)->detach();
d->agent = agent;
+ QScriptEngineAgentPrivate::get(d->agent)->attach();
}
/*!