Skip to content

Commit

Permalink
Update parse.js
Browse files Browse the repository at this point in the history
Added support for turning on the packed option manually.
  • Loading branch information
serkangunes committed Feb 20, 2017
1 parent 75bc576 commit dba295a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ function parse(source, root, options) {
field.comment = cmnt(trailingLine);
// JSON defaults to packed=true if not set so we have to set packed=false explicity when
// parsing proto2 descriptors without the option, where applicable.
if (field.repeated && !isProto3)
var packed = field.getOption('packed');
if (field.repeated && packed === undefined && !isProto3)
field.setOption("packed", false, /* ifNotSet */ true);
parent.add(field);
}
Expand Down

0 comments on commit dba295a

Please sign in to comment.