From 923eae8b16e4f9e7d121bc7b3084f4e717e2f166 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Mon, 18 Jul 2016 14:46:12 -0700 Subject: JavaScript maps: move binary callbacks out of constructor. This change will help us separate binary support into separate files, because we only refer to binary serialization functions in the actual binary serialization paths. --- js/message.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'js/message.js') diff --git a/js/message.js b/js/message.js index 3863bac0..e8185dee 100644 --- a/js/message.js +++ b/js/message.js @@ -747,29 +747,16 @@ jspb.Message.getFieldProto3 = function(msg, fieldNumber, defaultValue) { * of serialization/parsing callbacks (which are required by the map at * construction time, and the map may be constructed here). * - * The below callbacks are used to allow the map to serialize and parse its - * binary wire format data. Their purposes are described in more detail in - * `jspb.Map`'s constructor documentation. - * * @template K, V * @param {!jspb.Message} msg * @param {number} fieldNumber * @param {boolean|undefined} noLazyCreate * @param {?=} opt_valueCtor - * @param {function(number,K)=} opt_keyWriterFn - * @param {function():K=} opt_keyReaderFn - * @param {function(number,V)|function(number,V,?)| - * function(number,V,?,?,?,?)=} opt_valueWriterFn - * @param {function():V| - * function(V,function(?,?))=} opt_valueReaderFn - * @param {function(?,?)|function(?,?,?,?,?)=} opt_valueWriterCallback - * @param {function(?,?)=} opt_valueReaderCallback * @return {!jspb.Map|undefined} * @protected */ jspb.Message.getMapField = function(msg, fieldNumber, noLazyCreate, - opt_valueCtor, opt_keyWriterFn, opt_keyReaderFn, opt_valueWriterFn, - opt_valueReaderFn, opt_valueWriterCallback, opt_valueReaderCallback) { + opt_valueCtor) { if (!msg.wrappers_) { msg.wrappers_ = {}; } @@ -787,10 +774,7 @@ jspb.Message.getMapField = function(msg, fieldNumber, noLazyCreate, } return msg.wrappers_[fieldNumber] = new jspb.Map( - /** @type {!Array>} */ (arr), - opt_keyWriterFn, opt_keyReaderFn, opt_valueWriterFn, - opt_valueReaderFn, opt_valueCtor, opt_valueWriterCallback, - opt_valueReaderCallback); + /** @type {!Array>} */ (arr), opt_valueCtor); } }; -- cgit v1.2.3