diff options
author | Charlie Moad <cmoad@users.noreply.github.com> | 2018-04-02 18:44:28 -0400 |
---|---|---|
committer | Paul Yang <TeBoring@users.noreply.github.com> | 2018-04-02 15:44:28 -0700 |
commit | 579f81e1c66d64395031a1bbcb54ba7a44dade55 (patch) | |
tree | 725e9cd30598d29c820f47c880334cb5f9403f53 /js | |
parent | 40d6eca832641a3b2421742b5fd7aec3ad659396 (diff) | |
download | protobuf-579f81e1c66d64395031a1bbcb54ba7a44dade55.tar.gz protobuf-579f81e1c66d64395031a1bbcb54ba7a44dade55.tar.bz2 protobuf-579f81e1c66d64395031a1bbcb54ba7a44dade55.zip |
js message support for jstype string on integers (#4332)
Diffstat (limited to 'js')
-rw-r--r-- | js/message.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/message.js b/js/message.js index 04d43339..86d18295 100644 --- a/js/message.js +++ b/js/message.js @@ -923,6 +923,17 @@ jspb.Message.setProto3IntField = function(msg, fieldNumber, value) { /** + * Sets the value of a non-extension integer, handled as string, field of a proto3 + * @param {!jspb.Message} msg A jspb proto. + * @param {number} fieldNumber The field number. + * @param {number} value New value + * @protected + */ +jspb.Message.setProto3StringIntField = function(msg, fieldNumber, value) { + jspb.Message.setFieldIgnoringDefault_(msg, fieldNumber, value, '0'); +}; + +/** * Sets the value of a non-extension floating point field of a proto3 * @param {!jspb.Message} msg A jspb proto. * @param {number} fieldNumber The field number. |