func (r *reader) Next() bool {
	defer catchException(&r.err)
	return r.err == nil && r.Call("nextField").Bool() && !r.Call("isEndGroup").Bool()
}
Reads the next field header in the stream if there is one, returns true if
we saw a valid field header or false if we've read the whole stream.
Sets err if we encountered a deprecated START_GROUP/END_GROUP fielr.decoder.
package jspb
import "github.com/gopherjs/gopherjs/js"
type Reader interface {
	Next() bool
	Err() error
	GetFieldNumber() int
	SkipField()
	ReadInt32() int32
	ReadInt64() int64
	ReadUint32() uint32
	ReadUint64() uint64
	ReadSint32() int32
	ReadSint64() int64
	ReadFixed32() uint32
	ReadFixed64() uint64
	ReadSfixed32() int32
	ReadSfixed64() int64
	ReadFloat32() float32
	ReadFloat64() float64
	ReadEnum() int
	ReadBool() bool
	ReadString() string
	ReadBytes() []byte
	ReadInt32Slice() []int32
	ReadInt64Slice() []int64
	ReadUint32Slice() []uint32
	ReadUint64Slice() []uint64
	ReadSint32Slice() []int32
	ReadSint64Slice() []int64
	ReadFixed32Slice() []uint32
	ReadFixed64Slice() []uint64
	ReadSfixed32Slice() []int32
	ReadSfixed64Slice() []int64
	ReadFloat32Slice() []float32
	ReadFloat64Slice() []float64
	ReadEnumSlice() []int
	ReadBoolSlice() []bool
	ReadMessage(func())
}
type decoder struct {
	*js.Object
}
func (d decoder) ReadInt64() int64 {
	d.Call("readSplitVarint64_")
	high := d.Get("tempHigh_").Uint64()
	low := d.Get("tempLow_").Uint64()
	return d.mergeSignedInteger(low, high)
}
func (d decoder) ReadZigzag64() int64 {
	v := d.ReadUint64()
	return int64((v >> 1) ^ uint64((int64(v&1)<<63)>>63))
}
func (d decoder) ReadUint64() uint64 {
	d.Call("readSplitVarint64_")
	high := d.Get("tempHigh_").Uint64()
	low := d.Get("tempLow_").Uint64()
	return high<<32 | low
}
func (d decoder) ReadFixed64() uint64 {
	low := d.Call("readUint32").Uint64()
	high := d.Call("readUint32").Uint64()
	return high<<32 | low
}
func (d decoder) ReadSignedFixed64() int64 {
	low := d.Call("readUint32").Uint64()
	high := d.Call("readUint32").Uint64()
	return d.mergeSignedInteger(low, high)
}
func (d decoder) mergeSignedInteger(low, high uint64) int64 {
	negative := (high&0x8 == 1)
	if negative {
		low = (^low + 1)
		var carry uint64
		if low == 0 {
			carry = 1
		}
		high = (^high + carry)
	}
	return int64(high<<32 | low)
}
func NewReader(data []byte) Reader {
	r := &reader{
		Object: js.Global.Get("BinaryReader").New(data),
	}
	r.decoder = &decoder{
		Object: r.Get("decoder_"),
	}
	return r
}
type reader struct {
	*js.Object
	decoder *decoder
	err     error
}