Change from ES6 Map to old-fashioned object

This fixes the Kokoro tests broken by []

Unfortunately this means that the return type changes from a Map to an Object as well,
so all of the .get() lines need to turn into [].  Yay weakly typed languages. And
apparently in some error conditions this method could already return the Object type
anyway, even if you passed in a Map, so it's just poorly designed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213808477
This commit is contained in:
mcilwain 2018-09-20 07:30:42 -07:00 committed by Ben McIlwain
parent 399cde1291
commit ae2c1071f1
4 changed files with 21 additions and 20 deletions

View file

@ -48,13 +48,14 @@ registry.Session = function(defaultUri, xsrfToken, contentType) {
/**
* XHR request headers.
* @private {!Map.<string, string>}
* @private {!Object<string, string>}
* @const
*/
this.headers_ = new Map([
['Content-Type', contentType],
['X-CSRF-Token', xsrfToken],
['X-Requested-With', 'XMLHttpRequest']]);
this.headers_ = {
'Content-Type': contentType,
'X-CSRF-Token': xsrfToken,
'X-Requested-With': 'XMLHttpRequest'
};
};