Skip to content

Commit

Permalink
proto3: skip defaults
Browse files Browse the repository at this point in the history
Defaults are not supported in proto3, and therefore should
not be appended to a `.proto` file when using `-t proto3`
flag for `pbjs`.
  • Loading branch information
stelcheck committed Sep 4, 2017
1 parent 952c7d1 commit 9afb8a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cli/targets/proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ function buildFieldOptions(field) {
return;
break;
case "default":
if (syntax === 3)
return;
// skip default (resolved) default values
if (field.long && !util.longNeq(field.defaultValue, types.defaults[field.type]) || !field.long && field.defaultValue === types.defaults[field.type])
return;
Expand Down

0 comments on commit 9afb8a2

Please sign in to comment.