| 63 | } |
| 64 | |
| 65 | GJS_JSAPI_RETURN_CONVENTION |
| 66 | bool flush_func(JSContext* cx, unsigned argc, JS::Value* vp) { |
| 67 | GJS_GET_THIS(cx, argc, vp, argv, obj); |
| 68 | |
| 69 | if (argc > 1) { |
| 70 | gjs_throw(cx, "Surface.flush() takes no arguments"); |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | cairo_surface_t* surface = CairoSurface::for_js(cx, obj); |
| 75 | if (!surface) |
| 76 | return false; |
| 77 | |
| 78 | cairo_surface_flush(surface); |
| 79 | |
| 80 | if (!gjs_cairo_check_status(cx, cairo_surface_status(surface), "surface")) |
| 81 | return false; |
| 82 | |
| 83 | argv.rval().setUndefined(); |
| 84 | return true; |
| 85 | } |
| 86 | |
| 87 | GJS_JSAPI_RETURN_CONVENTION |
| 88 | bool finish_func(JSContext* cx, unsigned argc, JS::Value* vp) { |
nothing calls this directly
no test coverage detected