Fix deprecated suppresses and Map type in JS

This properly fixes the issue that was suppressed in [] and
just started breaking today thanks to []

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213510500
This commit is contained in:
mcilwain 2018-09-18 13:54:27 -07:00 committed by Ben McIlwain
parent 1f80f58336
commit 9bcd5579ef
2 changed files with 5 additions and 9 deletions

View file

@ -16,7 +16,6 @@ goog.provide('registry.Session');
goog.require('goog.json');
goog.require('goog.net.XhrIo');
goog.require('goog.structs.Map');
goog.require('registry.util');
goog.forwardDeclare('goog.Uri');
@ -30,7 +29,6 @@ goog.forwardDeclare('goog.Uri');
* @param {!registry.Session.ContentType} contentType Payload mode.
* @constructor
* @template REQUEST, RESPONSE
* @suppress {deprecated}
*/
registry.Session = function(defaultUri, xsrfToken, contentType) {
@ -50,13 +48,13 @@ registry.Session = function(defaultUri, xsrfToken, contentType) {
/**
* XHR request headers.
* @private {!goog.structs.Map.<string, string>}
* @private {!Map.<string, string>}
* @const
*/
this.headers_ = new goog.structs.Map(
'Content-Type', contentType,
'X-CSRF-Token', xsrfToken,
'X-Requested-With', 'XMLHttpRequest');
this.headers_ = new Map([
['Content-Type', contentType],
['X-CSRF-Token', xsrfToken],
['X-Requested-With', 'XMLHttpRequest']]);
};

View file

@ -34,10 +34,8 @@ registry.registrar.ConsoleTestUtil.setup = function(test) {
test.historyMock = test.mockControl.createLooseMock(goog.History, true);
test.sessionMock = test.mockControl.createLooseMock(
registry.registrar.EppSession, true);
/** @suppress {missingRequire} */
test.mockControl.createConstructorMock(goog, 'History')()
.$returns(test.historyMock);
/** @suppress {missingRequire} */
test.mockControl
.createConstructorMock(registry.registrar, 'EppSession')(
goog.testing.mockmatchers.isObject)