From 8493347dd9711848398e2d667080110a376be96d Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 21 Jan 2014 11:13:21 -0800 Subject: [PATCH] Allow usage of .type on objects of type Message. --- Execute.cpp | 4 ++++ Internal.hpp | 1 + ObjectiveC/Library.mm | 1 + 3 files changed, 6 insertions(+) diff --git a/Execute.cpp b/Execute.cpp index ed70a1d..8cd0c90 100644 --- a/Execute.cpp +++ b/Execute.cpp @@ -1419,6 +1419,10 @@ static JSStaticValue Functor_staticValues[2] = { {NULL, NULL, NULL, 0} }; +namespace cy { + JSStaticValue const * const Functor::StaticValues = Functor_staticValues; +} + static JSStaticValue Type_staticValues[4] = { {"alignment", &Type_getProperty_alignment, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, {"name", &Type_getProperty_name, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, diff --git a/Internal.hpp b/Internal.hpp index 7c278b4..cf35708 100644 --- a/Internal.hpp +++ b/Internal.hpp @@ -190,6 +190,7 @@ struct Functor : } static JSStaticFunction const * const StaticFunctions; + static JSStaticValue const * const StaticValues; }; } struct Closure_privateData : diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 6c7bbd2..7ac3bb0 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -2854,6 +2854,7 @@ void CYObjectiveC_Initialize() { /*XXX*/ JSContextRef context(NULL); CYPoolTry { definition = kJSClassDefinitionEmpty; definition.className = "Message"; definition.staticFunctions = cy::Functor::StaticFunctions; + definition.staticValues = cy::Functor::StaticValues; definition.callAsFunction = &Message_callAsFunction; definition.finalize = &CYFinalize; Message_ = JSClassCreate(&definition); -- 2.45.2