From 791bddfcd5cc7540219835ef5d91486acd833c4b Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 5 Aug 2009 11:35:51 +0200 Subject: add type info and attribute getters for function wrappers --- src/script/bridge/qscriptfunction.cpp | 2 ++ src/script/bridge/qscriptfunction_p.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/script/bridge/qscriptfunction.cpp b/src/script/bridge/qscriptfunction.cpp index 5b3de9e..1c8ea91 100644 --- a/src/script/bridge/qscriptfunction.cpp +++ b/src/script/bridge/qscriptfunction.cpp @@ -60,6 +60,8 @@ ASSERT_CLASS_FITS_IN_CELL(QScript::FunctionWithArgWrapper); namespace QScript { +const JSC::ClassInfo FunctionWrapper::info = { "QtNativeFunctionWrapper", &PrototypeFunction::info, 0, 0 }; +const JSC::ClassInfo FunctionWithArgWrapper::info = { "QtNativeFunctionWithArgWrapper", &PrototypeFunction::info, 0, 0 }; FunctionWrapper::FunctionWrapper(JSC::ExecState *exec, int length, const JSC::Identifier &name, QScriptEngine::FunctionSignature function) diff --git a/src/script/bridge/qscriptfunction_p.h b/src/script/bridge/qscriptfunction_p.h index 4901b72..6967274 100644 --- a/src/script/bridge/qscriptfunction_p.h +++ b/src/script/bridge/qscriptfunction_p.h @@ -79,6 +79,12 @@ public: QScriptEngine::FunctionSignature); ~FunctionWrapper(); + virtual const JSC::ClassInfo* classInfo() const { return &info; } + static const JSC::ClassInfo info; + + QScriptEngine::FunctionSignature function() const + { return data->function; } + private: virtual JSC::ConstructType getConstructData(JSC::ConstructData&); @@ -105,6 +111,15 @@ public: QScriptEngine::FunctionWithArgSignature, void *); ~FunctionWithArgWrapper(); + virtual const JSC::ClassInfo* classInfo() const { return &info; } + static const JSC::ClassInfo info; + + QScriptEngine::FunctionWithArgSignature function() const + { return data->function; } + + void *arg() const + { return data->arg; } + private: virtual JSC::ConstructType getConstructData(JSC::ConstructData&); -- cgit v0.12