From 33706cdc201bc863774c4af6ac2c38ad96a276e6 Mon Sep 17 00:00:00 2001 From: dcodeIO Date: Thu, 22 Dec 2016 13:41:44 +0100 Subject: [PATCH] Fixed: Properly set long defaults on prototypes --- src/class.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/class.js b/src/class.js index 1a20c2965..51c7e02be 100644 --- a/src/class.js +++ b/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