From f5d7110cd00f0884abe200716a0958cc0af04783 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 11 Sep 2012 09:43:28 -0700 Subject: [PATCH] Document a potential change to FunctionInstance. --- ObjectiveC/Library.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 4d51f29..b4e33c3 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -1871,6 +1871,11 @@ static JSValueRef Instance_callAsFunction(JSContextRef context, JSObjectRef obje if (![self isKindOfClass:NSBlock_]) CYThrow("non-NSBlock object is not a function"); + // XXX: replace above logic with the following assertion + //_assert([self isKindOfClass:NSBlock_]); + // to do this, make it so FunctionInstance_ is the class of blocks + // to do /that/, generalize the various "is exactly Instance_" checks + // then, move Instance_callAsFunction to only be on FunctionInstance struct BlockDescriptor1 { unsigned long int reserved; @@ -2566,15 +2571,15 @@ void CYObjectiveC_Initialize() { /*XXX*/ JSContextRef context(NULL); CYPoolTry { definition.className = "ArrayInstance"; ArrayInstance_ = JSClassCreate(&definition); - definition.className = "FunctionInstance"; - FunctionInstance_ = JSClassCreate(&definition); - definition.className = "ObjectInstance"; ObjectInstance_ = JSClassCreate(&definition); definition.className = "StringInstance"; StringInstance_ = JSClassCreate(&definition); + definition.className = "FunctionInstance"; + FunctionInstance_ = JSClassCreate(&definition); + definition = kJSClassDefinitionEmpty; definition.className = "Internal"; definition.staticFunctions = Internal_staticFunctions; -- 2.45.2