From d08de20171c0df99513514af050372fc1aee8720 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Fri, 13 Jul 2012 13:15:09 +0200 Subject: Fix QScriptContextInfo::functionMetaIndex() for overloaded slots This was a regression against the pre-JavaScriptCore implementation, where we used to store the selected method index as an internal member of the QScriptContext(Private). But in the JSC-based implementation, QScriptContext is implemented as a pointer to a JSC::CallFrame, and there are no unused fields in CallFrame where the method index can be stashed. Refactor the Qt method call logic so that the method selection is separate from the actual processing of the target method. This way, QScriptContextInfo can compute the method index the same way that the actual method call did. Task-number: QTBUG-6133 Change-Id: I619fa8b91542d0b6ab5a44b00266cc0705c95823 Reviewed-by: Olivier Goffart --- src/script/api/qscriptcontextinfo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/script/api/qscriptcontextinfo.cpp') diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index 31e7cfc..0e7884f 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -197,8 +197,7 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte // ### get the function name from the AST } else if (callee && callee->inherits(&QScript::QtFunction::info)) { functionType = QScriptContextInfo::QtFunction; - // ### the slot can be overloaded -- need to get the particular overload from the context - functionMetaIndex = static_cast(callee)->initialIndex(); + functionMetaIndex = static_cast(callee)->specificIndex(context); const QMetaObject *meta = static_cast(callee)->metaObject(); if (meta != 0) { QMetaMethod method = meta->method(functionMetaIndex); -- cgit v1.2.1