Skip to content

Commit

Permalink
Fix missing valuesOptions in fromJSON parser function
Browse files Browse the repository at this point in the history
I've found out that the "valuesOptions" option in the Enum class is missing when parsed from the JSON.

This PR should fix the issue: protobufjs#1961
  • Loading branch information
dobrac authored Apr 8, 2024
1 parent 2f846fe commit 0994a25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
* @throws {TypeError} If arguments are invalid
*/
Enum.fromJSON = function fromJSON(name, json) {
var enm = new Enum(name, json.values, json.options, json.comment, json.comments);
var enm = new Enum(name, json.values, json.options, json.comment, json.comments, json.valuesOptions);
enm.reserved = json.reserved;
return enm;
};
Expand Down

0 comments on commit 0994a25

Please sign in to comment.