
static JSValue js_file_prop_set(JSContext *ctx, JSValueConst this_val, JSValueConst value, int magic)
{
	s64 lival;
	FILE *f = JS_GetOpaque(this_val, file_class_id);
	if (!f) return GF_JS_EXCEPTION(ctx);

	switch (magic) {
	case JS_FILE_POS:
		if (JS_ToInt64(ctx, &lival, value)) return GF_JS_EXCEPTION(ctx);
		gf_fseek(f, lival, SEEK_SET);
		break;
	}
	return JS_UNDEFINED;

static JSValue js_file_prop_set(JSContext *ctx, JSValueConst this_val, JSValueConst value, int magic)
{
	s64 lival;
	FILE *f = JS_GetOpaque(this_val, file_class_id);
	if (!f) return GF_JS_EXCEPTION(ctx);

	switch (magic) {
	case JS_FILE_POS:
		if (JS_ToInt64(ctx, &lival, value)) return GF_JS_EXCEPTION(ctx);
		gf_fseek(f, lival, SEEK_SET);
		break;
	}
	return JS_UNDEFINED;