-
Notifications
You must be signed in to change notification settings - Fork 83
Description
When generating JavaScript files from .proto using protoc (tested with version 32.1), the code for map fields calls serializeBinary() on jspb.Map instances. In google-protobuf@4.0.0, jspb.Map.prototype.serializeBinary no longer exists, causing runtime errors: "TypeError: f.serializeBinary is not a function".
I have a proto file that contains an element of type "map":
message TemplateEntity {
....
map<string, TemplateProperty> properties = 10;
message TemplateProperty {
...
}
In the generated file "..._pb.js" I see this code which seems incompatible with version 4:
...
f = message.getPropertiesMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeMessage, proto.template.metadata.TemplateProperty.serializeBinaryToWriter);
}
...