| 1389 | } |
| 1390 | |
| 1391 | static FILE *js_std_file_get(JSContext *ctx, JSValueConst obj) |
| 1392 | { |
| 1393 | JSRuntime *rt = JS_GetRuntime(ctx); |
| 1394 | JSThreadState *ts = js_get_thread_state(rt); |
| 1395 | JSSTDFile *s = JS_GetOpaque2(ctx, obj, ts->std_file_class_id); |
| 1396 | if (!s) |
| 1397 | return NULL; |
| 1398 | if (!s->f) { |
| 1399 | JS_ThrowTypeError(ctx, "invalid file handle"); |
| 1400 | return NULL; |
| 1401 | } |
| 1402 | return s->f; |
| 1403 | } |
| 1404 | |
| 1405 | static JSValue js_std_file_puts(JSContext *ctx, JSValueConst this_val, |
| 1406 | int argc, JSValueConst *argv, int magic) |
no test coverage detected