Don't call functions on pointers that may not point to objects
The JSValue pointers sometimes are just a number (i.e. 3) so calling functions on them is not allowed (and is starting to crash on latest clang when compiled with optimization).
So always use a static function when the pointer may not be a real pointer