Skip to content

Commit 33706cd

Browse files
committed
Fixed: Properly set long defaults on prototypes
1 parent 99dc5fa commit 33706cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/class.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ function create(type, ctor) {
6565
// the value on the prototype for ALL messages of this type. Hence, these objects are frozen.
6666
prototype[field.name] = Array.isArray(field.resolve().defaultValue)
6767
? util.emptyArray
68-
: util.isObject(field.defaultValue)
69-
? util.emptyObject
70-
: field.defaultValue;
68+
: util.isObject(field.defaultValue) && !field.long
69+
? util.emptyObject
70+
: field.defaultValue;
7171
});
7272

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

0 commit comments

Comments
 (0)