See InterfaceBase::has_instance().
| 125 | |
| 126 | // See InterfaceBase::has_instance(). |
| 127 | bool InterfacePrototype::has_instance_impl(JSContext* cx, |
| 128 | const JS::CallArgs& args) { |
| 129 | // This method is never called directly, so no need for error messages. |
| 130 | g_assert(args.length() == 1); |
| 131 | |
| 132 | if (!args[0].isObject()) { |
| 133 | args.rval().setBoolean(false); |
| 134 | return true; |
| 135 | } |
| 136 | |
| 137 | JS::RootedObject instance(cx, &args[0].toObject()); |
| 138 | bool isinstance = |
| 139 | ObjectBase::typecheck(cx, instance, m_gtype, GjsTypecheckNoThrow{}); |
| 140 | args.rval().setBoolean(isinstance); |
| 141 | return true; |
| 142 | } |
| 143 | |
| 144 | const struct JSClassOps InterfaceBase::class_ops = { |
| 145 | nullptr, // addProperty |