| 39 | #include "util/console.h" |
| 40 | |
| 41 | GJS_JSAPI_RETURN_CONVENTION |
| 42 | static bool quit(JSContext* cx, unsigned argc, JS::Value* vp) { |
| 43 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); |
| 44 | |
| 45 | int32_t exitcode; |
| 46 | if (!gjs_parse_call_args(cx, "quit", args, "i", "exitcode", &exitcode)) |
| 47 | return false; |
| 48 | |
| 49 | GjsContextPrivate* gjs = GjsContextPrivate::from_cx(cx); |
| 50 | gjs->exit(exitcode); |
| 51 | JS::ReportUncatchableException(cx); |
| 52 | return false; |
| 53 | } |
| 54 | |
| 55 | GJS_JSAPI_RETURN_CONVENTION |
| 56 | static bool do_readline(JSContext* cx, unsigned argc, JS::Value* vp) { |
nothing calls this directly
no test coverage detected