summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptcontext.cpp')
-rw-r--r--src/script/api/qscriptcontext.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp
index 0b1ca33..6a85ede 100644
--- a/src/script/api/qscriptcontext.cpp
+++ b/src/script/api/qscriptcontext.cpp
@@ -305,8 +305,8 @@ QScriptValue QScriptContext::argumentsObject() const
{
JSC::CallFrame *frame = const_cast<JSC::ExecState*>(QScriptEnginePrivate::frameForContext(this));
- if (frame == frame->lexicalGlobalObject()->globalExec() || frame->callerFrame()->hasHostCallFrameFlag()) {
- // <global> or <eval> context doesn't have arguments. return an empty object
+ if (frame == frame->lexicalGlobalObject()->globalExec()) {
+ // <global> context doesn't have arguments. return an empty object
return QScriptEnginePrivate::get(QScript::scriptEngineFromExec(frame))->newObject();
}
@@ -316,6 +316,11 @@ QScriptValue QScriptContext::argumentsObject() const
return QScript::scriptEngineFromExec(frame)->scriptValueFromJSCValue(result);
}
+ if (frame->callerFrame()->hasHostCallFrameFlag()) {
+ // <eval> context doesn't have arguments. return an empty object
+ return QScriptEnginePrivate::get(QScript::scriptEngineFromExec(frame))->newObject();
+ }
+
//for a native function
if (!frame->optionalCalleeArguments()) {
Q_ASSERT(frame->argumentCount() > 0); //we need at least 'this' otherwise we'll crash later