JSNative property getter for `code`.
| 122 | |
| 123 | // JSNative property getter for `code`. |
| 124 | bool ErrorBase::get_code(JSContext* cx, unsigned argc, JS::Value* vp) { |
| 125 | GJS_CHECK_WRAPPER_PRIV(cx, argc, vp, args, obj, ErrorBase, priv); |
| 126 | if (!priv->check_is_instance(cx, "get a field")) |
| 127 | return false; |
| 128 | |
| 129 | args.rval().setInt32(priv->to_instance()->code()); |
| 130 | return true; |
| 131 | } |
| 132 | |
| 133 | // JSNative implementation of `toString()`. |
| 134 | bool ErrorBase::to_string(JSContext* cx, unsigned argc, JS::Value* vp) { |
nothing calls this directly
no test coverage detected