summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptcontext.cpp10
-rw-r--r--src/script/api/qscriptcontextinfo.cpp11
-rw-r--r--src/script/api/qscriptcontextinfo.h4
-rw-r--r--src/script/api/qscriptengine.cpp15
-rw-r--r--src/script/api/qscriptengineagent.cpp7
5 files changed, 23 insertions, 24 deletions
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 3f08e74..1a11100 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -323,6 +323,9 @@ QScriptValue QScriptContext::argumentsObject() const
When a function is called as constructor, the thisObject()
contains the newly constructed object to be initialized.
+
+ \note This function is only guarenteed to work for a context
+ corresponding to native functions.
*/
bool QScriptContext::isCalledAsConstructor() const
{
@@ -413,6 +416,9 @@ void QScriptContext::setReturnValue(const QScriptValue &result)
object provides access to the local variables associated with this
context.
+ \note The activation object might not be available if there is no
+ active QScriptEngineAgent, as it might be optimized.
+
\sa argument(), argumentsObject()
*/
@@ -472,6 +478,10 @@ QScriptValue QScriptContext::activationObject() const
activation.
If \a activation is not an object, this function does nothing.
+
+ \note For a context corresponding to a JavaScript function, this is only
+ guarenteed to work if there was an QScriptEngineAgent active on the
+ engine while the function was evaluated.
*/
void QScriptContext::setActivationObject(const QScriptValue &activation)
{
diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp
index ebb1770..a90e014 100644
--- a/src/script/api/qscriptcontextinfo.cpp
+++ b/src/script/api/qscriptcontextinfo.cpp
@@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE
current statement.
If the called function is executing Qt Script code, you can obtain
- the script location with the functions fileName(), lineNumber() and
- columnNumber().
+ the script location with the functions fileName() and lineNumber().
You can obtain the starting line number and ending line number of a
Qt Script function definition with functionStartLineNumber() and
@@ -317,13 +316,7 @@ int QScriptContextInfo::lineNumber() const
}
/*!
- Returns the column number corresponding to the statement being
- executed, or -1 if the column number is not available.
-
- The column number is only available if Qt Script code is being
- executed.
-
- \sa lineNumber(), fileName()
+ \obsolete
*/
int QScriptContextInfo::columnNumber() const
{
diff --git a/src/script/api/qscriptcontextinfo.h b/src/script/api/qscriptcontextinfo.h
index d0b3f21..64a1e15 100644
--- a/src/script/api/qscriptcontextinfo.h
+++ b/src/script/api/qscriptcontextinfo.h
@@ -69,7 +69,9 @@ public:
qint64 scriptId() const;
QString fileName() const;
int lineNumber() const;
- int columnNumber() const;
+#ifdef QT_DEPRECATED
+ QT_DEPRECATED int columnNumber() const;
+#endif
QString functionName() const;
FunctionType functionType() const;
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 26673f4..8560214 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -44,7 +44,6 @@
#include "CodeBlock.h"
#include "Error.h"
-#include "JSLock.h"
#include "Interpreter.h"
#include "PrototypeFunction.h"
@@ -152,8 +151,7 @@ QT_BEGIN_NAMESPACE
evaluation caused an exception by calling hasUncaughtException(). In
that case, you can call toString() on the error object to obtain an
error message. The current uncaught exception is also available
- through uncaughtException(). You can obtain a human-readable
- backtrace of the exception with uncaughtExceptionBacktrace().
+ through uncaughtException().
Calling clearExceptions() will cause any uncaught exceptions to be
cleared.
@@ -1003,7 +1001,6 @@ QScriptEnginePrivate::~QScriptEnginePrivate()
detachAllRegisteredScriptStrings();
qDeleteAll(m_qobjectData);
qDeleteAll(m_typeInfos);
- JSC::JSLock lock(false);
globalData->heap.destroy();
globalData->deref();
while (freeScriptValues) {
@@ -1292,7 +1289,6 @@ bool QScriptEnginePrivate::isCollecting() const
void QScriptEnginePrivate::collectGarbage()
{
- JSC::JSLock lock(false);
QScript::APIShim shim(this);
globalData->heap.collectAllGarbage();
}
@@ -1322,7 +1318,6 @@ JSC::JSValue QScriptEnginePrivate::evaluateHelper(JSC::ExecState *exec, intptr_t
bool &compile)
{
Q_Q(QScriptEngine);
- JSC::JSLock lock(false); // ### hmmm
QBoolBlocker inEvalBlocker(inEval, true);
q->currentContext()->activationObject(); //force the creation of a context for native function;
@@ -2800,8 +2795,7 @@ void QScriptEnginePrivate::popContext()
The exception state is cleared when evaluate() is called.
- \sa uncaughtException(), uncaughtExceptionLineNumber(),
- uncaughtExceptionBacktrace()
+ \sa uncaughtException(), uncaughtExceptionLineNumber()
*/
bool QScriptEngine::hasUncaughtException() const
{
@@ -2819,7 +2813,6 @@ bool QScriptEngine::hasUncaughtException() const
message.
\sa hasUncaughtException(), uncaughtExceptionLineNumber(),
- uncaughtExceptionBacktrace()
*/
QScriptValue QScriptEngine::uncaughtException() const
{
@@ -2839,7 +2832,7 @@ QScriptValue QScriptEngine::uncaughtException() const
Line numbers are 1-based, unless a different base was specified as
the second argument to evaluate().
- \sa hasUncaughtException(), uncaughtExceptionBacktrace()
+ \sa hasUncaughtException()
*/
int QScriptEngine::uncaughtExceptionLineNumber() const
{
@@ -2851,7 +2844,7 @@ int QScriptEngine::uncaughtExceptionLineNumber() const
/*!
Returns a human-readable backtrace of the last uncaught exception.
- Each line is of the form \c{<function-name>(<arguments>)@<file-name>:<line-number>}.
+ It is in the form \c{<function-name>()@<file-name>:<line-number>}.
\sa uncaughtException()
*/
diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp
index c3d1566..b1f131e 100644
--- a/src/script/api/qscriptengineagent.cpp
+++ b/src/script/api/qscriptengineagent.cpp
@@ -372,9 +372,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId,
/*!
This function is called when the engine is about to execute a new
statement in the script identified by \a scriptId. The statement
- begins on the line and column specified by \a lineNumber and \a
- columnNumber. This event is not generated for native Qt Script
- functions.
+ begins on the line and column specified by \a lineNumber
+ This event is not generated for native Qt Script functions.
Reimplement this function to handle this event. For example, a
debugger implementation could reimplement this function to provide
@@ -383,6 +382,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId,
The default implementation does nothing.
+ \note \a columnNumber is undefined
+
\sa scriptLoad(), functionEntry()
*/
void QScriptEngineAgent::positionChange(qint64 scriptId,