+static JSValueRef Global_getProperty(JSContextRef context, JSObjectRef object, JSStringRef name, JSValueRef *exception) { _pooled
+ @try {
+ NSString *string(CYCastNSString(name));
+ if (Class _class = NSClassFromString(string))
+ return CYMakeObject(context, _class);
+ if (NSMutableArray *entry = [Bridge_ objectForKey:string])
+ switch ([[entry objectAtIndex:0] intValue]) {
+ case 0:
+ return JSEvaluateScript(JSGetContext(), CYString([entry objectAtIndex:1]), NULL, NULL, 0, NULL);
+ case 1:
+ return CYMakeFunction(context, [string cy$symbol], [[entry objectAtIndex:1] UTF8String]);
+ case 2:
+ CYPool pool;
+ sig::Signature signature;
+ sig::Parse(pool, &signature, [[entry objectAtIndex:1] UTF8String]);
+ return CYFromFFI(context, signature.elements[0].type, [string cy$symbol]);
+ }
+ return NULL;
+ } CYCatch
+}
+