If you store
JSObjectRef on a static global or on the heap, the GC may inadvertently free these objects potentially causing memory corruption / crashes. To prevent this you should use
JSValueUnprotect() to keep them alive.
Updated almost 2 years ago