static JSValue js_bs_prop_get(JSContext *ctx, JSValueConst this_val, int magic)
{
	GET_JSBS
	if (!bs) return GF_JS_EXCEPTION(ctx);
	switch (magic) {
	case JS_BS_POS:
		return JS_NewInt64(ctx, gf_bs_get_position(bs));
	case JS_BS_SIZE:
		return JS_NewInt64(ctx, gf_bs_get_size(bs));
	case JS_BS_REFRESH_SIZE:
		return JS_NewInt64(ctx, gf_bs_get_refreshed_size(bs));
	case JS_BS_BIT_OFFSET:
		return JS_NewInt64(ctx, gf_bs_get_bit_offset(bs));
	case JS_BS_BIT_POS:
		return JS_NewInt64(ctx, gf_bs_get_bit_position(bs));
	case JS_BS_AVAILABLE:
		return JS_NewInt64(ctx, gf_bs_available(bs));
	case JS_BS_BITS_AVAILABLE:
		return JS_NewInt32(ctx, gf_bs_bits_available(bs));
	}
	return JS_UNDEFINED;

}
static JSValue js_bs_prop_get(JSContext *ctx, JSValueConst this_val, int magic)
{
	GET_JSBS
	if (!bs) return GF_JS_EXCEPTION(ctx);
	switch (magic) {
	case JS_BS_POS:
		return JS_NewInt64(ctx, gf_bs_get_position(bs));
	case JS_BS_SIZE:
		return JS_NewInt64(ctx, gf_bs_get_size(bs));
	case JS_BS_REFRESH_SIZE:
		return JS_NewInt64(ctx, gf_bs_get_refreshed_size(bs));
	case JS_BS_BIT_OFFSET:
		return JS_NewInt64(ctx, gf_bs_get_bit_offset(bs));
	case JS_BS_BIT_POS:
		return JS_NewInt64(ctx, gf_bs_get_bit_position(bs));
	case JS_BS_AVAILABLE:
		return JS_NewInt64(ctx, gf_bs_available(bs));
	case JS_BS_BITS_AVAILABLE:
		return JS_NewInt32(ctx, gf_bs_bits_available(bs));
	}
	return JS_UNDEFINED;

}