johanbrandhorst / protobuf

GopherJS Bindings for ProtobufJS and gRPC-Web
MIT License
81 stars 16 forks source link

protoc-gen-gopherjs: Add field Has and Clear methods #4

Closed johanbrandhorst closed 7 years ago

johanbrandhorst commented 7 years ago

The javascript code defines hasX and clearX for all fields - we should do the same.

johanbrandhorst commented 7 years ago

Correction - it only generates hasX for Oneof and Message fields in proto3, and only clear for Oneof, messages, repeated and maps: https://developers.google.com/protocol-buffers/docs/reference/javascript-generated.