Commit 71f8e567 authored by jhawkins's avatar jhawkins Committed by Commit bot

remoting: Fix JSCompiler issues blocking ES6 transition.

* @suppress reportUnknownTypes for code using |arguments|, which is not well-handled by the JSCompiler type system.
* Fix up ad hoc documentation into proper JSDoc annotation so the type system doesn't get hung up.

R=garykac@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1204023003

Cr-Commit-Position: refs/heads/master@{#336044}
parent 56c1d881
......@@ -65,6 +65,7 @@ base.Disposable.prototype.dispose = function() {};
* @constructor
* @param {...base.Disposable} var_args
* @implements {base.Disposable}
* @suppress {reportUnknownTypes}
*/
base.Disposables = function(var_args) {
/**
......@@ -76,6 +77,7 @@ base.Disposables = function(var_args) {
/**
* @param {...base.Disposable} var_args
* @suppress {reportUnknownTypes}
*/
base.Disposables.prototype.add = function(var_args) {
var disposables = Array.prototype.slice.call(arguments, 0);
......@@ -90,6 +92,7 @@ base.Disposables.prototype.add = function(var_args) {
/**
* @param {...base.Disposable} var_args Dispose |var_args| and remove
* them from the current object.
* @suppress {reportUnknownTypes}
*/
base.Disposables.prototype.remove = function(var_args) {
var disposables = Array.prototype.slice.call(arguments, 0);
......
......@@ -54,6 +54,7 @@ remoting.Error.prototype.getDetail = function() {
* @param {remoting.Error.Tag} tag
* @param {...remoting.Error.Tag} var_args
* @return {boolean} True if this object has one of the specified tags.
* @suppress {reportUnknownTypes}
*/
remoting.Error.prototype.hasTag = function(tag, var_args) {
var thisTag = this.tag_;
......
......@@ -146,6 +146,7 @@ base.Ipc.prototype.onMessage_ = function(message, sender, sendResponse) {
* @param {...} var_args
* @return {Promise} A Promise that would resolve to the return value of the
* handler or reject if the handler throws an exception.
* @suppress {reportUnknownTypes}
*/
base.Ipc.invoke = function(methodName, var_args) {
var params = Array.prototype.slice.call(arguments, 1);
......
......@@ -51,6 +51,7 @@ browserTest.FakeDesktopViewport.prototype.getBumpScrollerForTesting =
return this.bumpScroller_;
};
/** @suppress {reportUnknownTypes} */
browserTest.FakeDesktopViewport.prototype.raiseEvent =
function() {
return this.bumpScroller_.raiseEvent.apply(this.bumpScroller_, arguments);
......
......@@ -37,6 +37,7 @@ chromeMocks.Event.prototype.removeListener = function(callback) {
/**
* @param {...*} var_args
* @return {void}
* @suppress {reportUnknownTypes}
*/
chromeMocks.Event.prototype.mock$fire = function(var_args) {
var params = Array.prototype.slice.call(arguments);
......
......@@ -30,9 +30,10 @@ function assertInitialState(/** QUnit.Assert */ assert) {
}
/**
* @param {!QUnit.Assert} assert
* @return {!Promise}
*/
function finish(/** QUnit.Assert */ assert) {
function finish(assert) {
return base.SpyPromise.settleAll().then(function() {
assert.equal(
base.SpyPromise.unsettledCount, 0,
......@@ -143,11 +144,13 @@ QUnit.test('reject/catch', function(assert) {
QUnit.test('all', function(assert) {
var done = assert.async();
base.SpyPromise.all([Promise.resolve(1), Promise.resolve(2)]).
then(function(/**string*/ value) {
assert.equal(base.SpyPromise.unsettledCount, 0);
assert.deepEqual(value, [1, 2]);
done();
});
then(
/** @param {string} value */
function(value) {
assert.equal(base.SpyPromise.unsettledCount, 0);
assert.deepEqual(value, [1, 2]);
done();
});
assert.equal(base.SpyPromise.unsettledCount, 1);
return finish(assert);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment