| 2541 | } |
| 2542 | |
| 2543 | static int call_handler(JSContext *ctx, JSValue func) |
| 2544 | { |
| 2545 | int r; |
| 2546 | JSValue ret, func1; |
| 2547 | /* 'func' might be destroyed when calling itself (if it frees the |
| 2548 | handler), so must take extra care */ |
| 2549 | func1 = JS_DupValue(ctx, func); |
| 2550 | ret = JS_Call(ctx, func1, JS_UNDEFINED, 0, NULL); |
| 2551 | JS_FreeValue(ctx, func1); |
| 2552 | r = 0; |
| 2553 | if (JS_IsException(ret)) |
| 2554 | r = -1; |
| 2555 | JS_FreeValue(ctx, ret); |
| 2556 | return r; |
| 2557 | } |
| 2558 | |
| 2559 | static int js_os_run_timers(JSRuntime *rt, JSContext *ctx, JSThreadState *ts, int *min_delay) |
| 2560 | { |
no test coverage detected