diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-27 13:25:50 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-07-27 13:43:33 (GMT) |
commit | f41b7967b279609d9d4e1a872c92e753f9aefad3 (patch) | |
tree | 12b0c6155e8e169919f3b403a77478b47a855679 /src/script/api | |
parent | 76d112eb3c7ea9045f26bee070302924a84fb15c (diff) | |
download | Qt-f41b7967b279609d9d4e1a872c92e753f9aefad3.zip Qt-f41b7967b279609d9d4e1a872c92e753f9aefad3.tar.gz Qt-f41b7967b279609d9d4e1a872c92e753f9aefad3.tar.bz2 |
Fix tst_QScriptContext::arguments
Diffstat (limited to 'src/script/api')
-rw-r--r-- | src/script/api/qscriptcontext.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index fc34122..e05e786 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -335,9 +335,10 @@ QScriptValue QScriptContext::argumentsObject() const { Q_D(const QScriptContext); if (d->frame == d->engine->globalObject->globalExec()) { - qWarning("QScriptContext::argumentsObject() not implemented for global context"); - return QScriptValue(); + //global context doesn't have any argument, return an empty object + return static_cast<QScriptEngine *>(d->engine->q_ptr)->newObject(); } + Q_ASSERT(d->frame->argumentCount() > 0); //we need at least 'this' otherwise we'll crash later if (!d->frame->optionalCalleeArguments()) { JSC::Arguments* arguments = new (&d->frame->globalData())JSC::Arguments(d->frame, JSC::Arguments::NoParameters); d->frame->setCalleeArguments(arguments); |