Checking `instanceof` for primitive types may lead to a crash or error
Apparently we've a bug for quite a lot of versions (tested down up to 1.64):
gjs -c "12345 instanceof imports.gi.Gio.File" # crash!
Gjs:ERROR:../gi/interface.cpp:119:bool InterfacePrototype::has_instance_impl(JSContext*, const JS::CallArgs&): assertion failed: (args[0].isObject())
Bail out! Gjs:ERROR:../gi/interface.cpp:119:bool InterfacePrototype::has_instance_impl(JSContext*, const JS::CallArgs&): assertion failed: (args[0].isObject())
print(null instanceof AGObjectInterface);
(gjs:3393416): Gjs-CRITICAL **: 00:50:39.133: JS ERROR: Error: Argument type may not be null
interfaceInstanceOf@resource:///org/gnome/gjs/modules/core/overrides/GObject.js:595:28
@/tmp/test.js:65:1