Permalink
Browse files

Fixed: Properly set long defaults on prototypes

  • Loading branch information...
dcodeIO committed Dec 22, 2016
1 parent 99dc5fa commit 33706cdc201bc863774c4af6ac2c38ad96a276e6
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/class.js
@@ -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

0 comments on commit 33706cd

Please sign in to comment.