
static Bool jsfio_eof(GF_FileIO *fileio)
{
	JSValue res;
	s32 ret;
	JSFileIOCtx *ioctx = gf_fileio_get_udta(fileio);
	if (!ioctx || !ioctx->gfio) return GF_BAD_PARAM;
	JSContext *ctx = ioctx->factory->ctx;
	gf_js_lock(ctx, GF_TRUE);
	res = JS_Call(ctx, ioctx->factory->eof, ioctx->js_obj, 0, NULL);
	JS_ToInt32(ctx, &ret, res);
	JS_FreeValue(ctx, res);
	gf_js_lock(ctx, GF_FALSE);
	return ret ? GF_TRUE : GF_FALSE;

static Bool jsfio_eof(GF_FileIO *fileio)
{
	JSValue res;
	s32 ret;
	JSFileIOCtx *ioctx = gf_fileio_get_udta(fileio);
	if (!ioctx || !ioctx->gfio) return GF_BAD_PARAM;
	JSContext *ctx = ioctx->factory->ctx;
	gf_js_lock(ctx, GF_TRUE);
	res = JS_Call(ctx, ioctx->factory->eof, ioctx->js_obj, 0, NULL);
	JS_ToInt32(ctx, &ret, res);
	JS_FreeValue(ctx, res);
	gf_js_lock(ctx, GF_FALSE);
	return ret ? GF_TRUE : GF_FALSE;