summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-09 01:48:18 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-09 01:48:18 (GMT)
commitaf454feab24824a7ef2d28794930fb7c227c270f (patch)
tree625ce5ab9e6c1323d3fbf8811cd958a3eda513fb /src/script
parent193fb1e278da5ec7b502859763712456708e9d95 (diff)
downloadQt-af454feab24824a7ef2d28794930fb7c227c270f.zip
Qt-af454feab24824a7ef2d28794930fb7c227c270f.tar.gz
Qt-af454feab24824a7ef2d28794930fb7c227c270f.tar.bz2
Do not add public API to QScriptEngine
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp29
-rw-r--r--src/script/api/qscriptengine.h1
-rw-r--r--src/script/bridge/qscriptdeclarativeclass.cpp33
-rw-r--r--src/script/bridge/qscriptdeclarativeclass_p.h1
4 files changed, 34 insertions, 30 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index cd82b9e..216f325 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2288,35 +2288,6 @@ QScriptContext *QScriptEngine::pushContext()
return d->contextForFrame(newFrame);
}
-/*!
- Enters a new execution context and returns the associated
- QScriptContext object.
-
- Once you are done with the context, you should call popContext() to
- restore the old context.
-
- By default, the `this' object of the new context is the Global Object.
- The context's \l{QScriptContext::callee()}{callee}() will be invalid.
-
- Unlike pushContext(), the default scope chain is reset to include
- only the global object and the QScriptContext's activation object.
-
- \sa popContext()
-*/
-QScriptContext *QScriptEngine::pushCleanContext()
-{
- Q_D(QScriptEngine);
-
- JSC::CallFrame* newFrame = d->pushContext(d->currentFrame, d->currentFrame->globalData().dynamicGlobalObject,
- JSC::ArgList(), /*callee = */0, false, true);
-
- if (agent())
- agent()->contextPush();
-
- return d->contextForFrame(newFrame);
-}
-
-
/*! \internal
push a context for a native function.
JSC native function doesn't have different stackframe or context. so we need to create one.
diff --git a/src/script/api/qscriptengine.h b/src/script/api/qscriptengine.h
index de4dc02..7db61e1 100644
--- a/src/script/api/qscriptengine.h
+++ b/src/script/api/qscriptengine.h
@@ -160,7 +160,6 @@ public:
QScriptContext *currentContext() const;
QScriptContext *pushContext();
- QScriptContext *pushCleanContext();
void popContext();
bool canEvaluate(const QString &program) const;
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp
index f0c1c45..b5d9bf5 100644
--- a/src/script/bridge/qscriptdeclarativeclass.cpp
+++ b/src/script/bridge/qscriptdeclarativeclass.cpp
@@ -44,6 +44,7 @@
#include "qscriptobject_p.h"
#include <QtScript/qscriptstring.h>
#include <QtScript/qscriptengine.h>
+#include <QtScript/qscriptengineagent.h>
#include <private/qscriptengine_p.h>
#include <private/qscriptvalue_p.h>
#include <private/qscriptqobject_p.h>
@@ -217,6 +218,38 @@ QScriptValue QScriptDeclarativeClass::scopeChainValue(QScriptContext *context, i
return QScriptValue();
}
+/*!
+ Enters a new execution context and returns the associated
+ QScriptContext object.
+
+ Once you are done with the context, you should call popContext() to
+ restore the old context.
+
+ By default, the `this' object of the new context is the Global Object.
+ The context's \l{QScriptContext::callee()}{callee}() will be invalid.
+
+ Unlike pushContext(), the default scope chain is reset to include
+ only the global object and the QScriptContext's activation object.
+
+ \sa QScriptEngine::popContext()
+*/
+QScriptContext * QScriptDeclarativeClass::pushCleanContext(QScriptEngine *engine)
+{
+ if (!engine)
+ return 0;
+
+ QScriptEnginePrivate *d = QScriptEnginePrivate::get(engine);
+
+ JSC::CallFrame* newFrame = d->pushContext(d->currentFrame,
+ d->currentFrame->globalData().dynamicGlobalObject,
+ JSC::ArgList(), /*callee = */0, false, true);
+
+ if (engine->agent())
+ engine->agent()->contextPush();
+
+ return d->contextForFrame(newFrame);
+}
+
QScriptDeclarativeClass::~QScriptDeclarativeClass()
{
}
diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h
index 4e06931..d0e653d 100644
--- a/src/script/bridge/qscriptdeclarativeclass_p.h
+++ b/src/script/bridge/qscriptdeclarativeclass_p.h
@@ -77,6 +77,7 @@ public:
static QScriptValue property(const QScriptValue &, const Identifier &);
static QScriptValue scopeChainValue(QScriptContext *, int index);
+ static QScriptContext *pushCleanContext(QScriptEngine *);
class Q_SCRIPT_EXPORT PersistentIdentifier
{