Hey Patrick,
I'm not sure why, but although test #55 works fine for me, I can't get
canSetOnBoxedObjects to work in my actual use-case scenario (keep
getting argument mismatch errors because it's going straight to the
Objective-C method and bypassing my Javascript method).
canSetOnBoxedObjects works in general; if I use a name that isn't
shared by an Objective-C method, the functionality is exactly what I
expect. For instance:
// Function is defined higher up in the closure
var insertTextSnippet = function() { ... };
__jsc__.canSetOnBoxedObjects = true;
// This works:
context.insertTextSnippetSpecial = insertTextSnippet;
// This doesn't:
context.insertTextSnippet = insertTextSnippet;
I've tried to find where in the JSCocoa source things are going wonky,
but I'm not sure what functions are being called. Originally, I
thought the problem might be because the test uses an object defined
in JSCocoa (which means it will have the selector JSValueForJSName:
while my Objective-C object does not, allowing the logic around line
3341 in JSCocoaController.m to trigger for the test but not my code),
but if the problem were that my object can't lookup items in its JS
hash then it seems like context.insertTextSnippetSpecial shouldn't
work, either.
Do you have any advice on the best way to debug this problem? I'm
quite willing to hack around in the JSCocoa source, but my
understanding of its underlying logic is still a little fuzzy so any
advice on what method is likely causing the issue would be very
helpful.
Ian