From 6239633ad3ae2b707ebc491ec1453f791150dc1a Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 9 Jul 2009 09:31:01 +0200 Subject: support callees that are not function objects E.g. QScriptClass-based objects. --- src/script/api/qscriptcontextinfo.cpp | 2 +- src/script/api/qscriptvalue.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index 7f928ef..21c6341 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -129,7 +129,7 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte const QScriptContextPrivate *ctx_p = QScriptContextPrivate::get(context); JSC::ExecState *frame = ctx_p->frame; - JSC::InternalFunction *callee = frame->callee(); + JSC::JSObject *callee = frame->callee(); if (callee && callee->isObject(&JSC::JSFunction::info)) { functionType = QScriptContextInfo::ScriptFunction; JSC::SourceProvider *source = frame->codeBlock()->source(); diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index a120d9c..9fc860e 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -1922,7 +1922,7 @@ QScriptValue QScriptValue::call(const QScriptValue &thisObject, newCallFrame[++dst] = *it; newCallFrame += argc + JSC::RegisterFile::CallFrameHeaderSize; // ### dst? - newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asInternalFunction(callee)); + newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asObject(callee)); result = callData.native.function(newCallFrame, JSC::asObject(callee), jscThisObject, jscArgs); interp->registerFile().shrink(oldEnd); } @@ -2019,7 +2019,7 @@ QScriptValue QScriptValue::call(const QScriptValue &thisObject, newCallFrame[++dst] = *it; newCallFrame += argc + JSC::RegisterFile::CallFrameHeaderSize; // ### dst? - newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asInternalFunction(callee)); + newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asObject(callee)); result = callData.native.function(newCallFrame, JSC::asObject(callee), jscThisObject, applyArgs); interp->registerFile().shrink(oldEnd); } @@ -2096,7 +2096,7 @@ QScriptValue QScriptValue::construct(const QScriptValueList &args) newCallFrame[++dst] = *it; newCallFrame += argc + JSC::RegisterFile::CallFrameHeaderSize; // ### dst? - newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asInternalFunction(callee)); + newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asObject(callee)); result = constructData.native.function(newCallFrame, JSC::asObject(callee), jscArgs); interp->registerFile().shrink(oldEnd); } @@ -2178,7 +2178,7 @@ QScriptValue QScriptValue::construct(const QScriptValue &arguments) newCallFrame[++dst] = *it; newCallFrame += argc + JSC::RegisterFile::CallFrameHeaderSize; // ### dst? - newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asInternalFunction(callee)); + newCallFrame->init(0, /*vPC=*/0, scopeChain, exec, dst, argc, JSC::asObject(callee)); result = constructData.native.function(newCallFrame, JSC::asObject(callee), applyArgs); interp->registerFile().shrink(oldEnd); } -- cgit v0.12