aboutsummaryrefslogtreecommitdiffhomepage
path: root/js
diff options
context:
space:
mode:
authorGravatar Josh Haberman <jhaberman@gmail.com>2016-09-28 10:52:32 -0700
committerGravatar Bo Yang <teboring@google.com>2016-10-10 11:44:21 -0700
commitf2eeaf7110b0f9b60c7b31bda7e0b20d6b7fb029 (patch)
tree3c2c9caa590fc8a7ef603af34b3535e53cefeea2 /js
parent4a4a1627c158d976ee80f278024a49ced8b12712 (diff)
Added alias getFieldProto3 as used by older generated code.
Un-breaks users who have old generated code and upgrade to the 3.1.0 release.
Diffstat (limited to 'js')
-rw-r--r--js/message.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/message.js b/js/message.js
index b150722a..8def763e 100644
--- a/js/message.js
+++ b/js/message.js
@@ -755,6 +755,18 @@ jspb.Message.getFieldWithDefault = function(msg, fieldNumber, defaultValue) {
/**
+ * Alias for getFieldWithDefault used by older generated code.
+ * @template T
+ * @param {!jspb.Message} msg A jspb proto.
+ * @param {number} fieldNumber The field number.
+ * @param {T} defaultValue The default value.
+ * @return {T} The field's value.
+ * @protected
+ */
+jspb.Message.getFieldProto3 = jspb.Message.getFieldWithDefault;
+
+
+/**
* Gets the value of a map field, lazily creating the map container if
* necessary.
*