
static JSValue js_fileio_prop_get(JSContext *ctx, JSValueConst this_val, int magic)
{
	JSFileIOCtx *ioctx = JS_GetOpaque(this_val, fileio_class_id);
	if (!ioctx) return GF_JS_EXCEPTION(ctx);

	switch (magic) {
	case JS_FILEIO_URL:
		return JS_NewString(ctx, gf_fileio_url(ioctx->gfio) );
	case JS_FILEIO_RES_URL:
		return JS_NewString(ctx, gf_fileio_resource_url(ioctx->gfio) );
	case JS_FILEIO_PARENT:
		return JS_DupValue(ctx, ioctx->factory->factory_obj);
	}
	return JS_UNDEFINED;

static JSValue js_fileio_prop_get(JSContext *ctx, JSValueConst this_val, int magic)
{
	JSFileIOCtx *ioctx = JS_GetOpaque(this_val, fileio_class_id);
	if (!ioctx) return GF_JS_EXCEPTION(ctx);

	switch (magic) {
	case JS_FILEIO_URL:
		return JS_NewString(ctx, gf_fileio_url(ioctx->gfio) );
	case JS_FILEIO_RES_URL:
		return JS_NewString(ctx, gf_fileio_resource_url(ioctx->gfio) );
	case JS_FILEIO_PARENT:
		return JS_DupValue(ctx, ioctx->factory->factory_obj);
	}
	return JS_UNDEFINED;