Skip to content

Commit

Permalink
Fixed: Properly set long defaults on prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodeIO committed Dec 22, 2016
1 parent 99dc5fa commit 33706cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function create(type, ctor) {
// the value on the prototype for ALL messages of this type. Hence, these objects are frozen.
prototype[field.name] = Array.isArray(field.resolve().defaultValue)
? util.emptyArray
: util.isObject(field.defaultValue)
? util.emptyObject
: field.defaultValue;
: util.isObject(field.defaultValue) && !field.long
? util.emptyObject
: field.defaultValue;
});

// Messages have non-enumerable getters and setters for each virtual oneof field
Expand Down

0 comments on commit 33706cd

Please sign in to comment.