CocoaScript icon indicating copy to clipboard operation
CocoaScript copied to clipboard

FIXMEs

Open samdeane opened this issue 11 years ago • 1 comments

I'm trying to get down to 0 warnings. If there's anything I can do to help with the #FIXME items in the code, let me know.

This one sounds easy enough, but I'm not sure what it should do if the function is nil.

#pragma message "FIXME: Check to see if function is nil or not."

Similarly, this one could do with a bit more explanation:

#pragma message "FIXME: we should stash a weak ref to the COScript at creation time, because who knows what other COScript might be around"

Of course it may be that it would take more time to explain what needs doing than to do it - in which case ignore me and close this ;)

samdeane avatar May 24 '14 07:05 samdeane

The first one should probably throw an error (a JS exception at least).

The for the second one- the problem is that when callAction: is used, it looks at the current thread and whatever COScript is around and uses that jscontext. That's a bad idea if it's not the context which the COSTarget was created for. So initWithJSFunction: should somehow grab the current COScript that it's executing in and stash that in a weak ivar.

ccgus avatar May 24 '14 17:05 ccgus