From 8b54280395fe9236428c7a50c9b6c0e57c3131e5 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 28 Sep 2016 10:52:32 -0700 Subject: [PATCH] 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. --- js/message.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/message.js b/js/message.js index b150722a35..8def763e9c 100644 --- a/js/message.js +++ b/js/message.js @@ -754,6 +754,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.