Skip to content

Commit 8d0697d

Browse files
committed
Fxied compiler warnings.
1 parent 6b60e04 commit 8d0697d

File tree

8 files changed

+317
-891
lines changed

8 files changed

+317
-891
lines changed

package-lock.json

Lines changed: 275 additions & 861 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"dependencies": {},
99
"devDependencies": {
1010
"bestzip": "^1.1.6",
11-
"closure-builder": "^2.3.2",
11+
"closure-builder": "^2.3.4",
1212
"command-line-usage": "^5.0.5",
1313
"escape-string-regexp": "^1.0.5",
1414
"eslint": "^4.19.1",
1515
"eslint-config-google": "^0.9.1",
1616
"http-server": "latest",
1717
"jasmine-core": "^3.3.0",
1818
"jsdoc": "^3.5.5",
19-
"karma": "^3.1.1",
19+
"karma": "^3.1.4",
2020
"karma-chrome-launcher": "latest",
2121
"karma-closure": "latest",
2222
"karma-coverage": "^1.1.2",
@@ -27,9 +27,9 @@
2727
"markdownlint-cli": "^0.8.1",
2828
"mv": "^2.1.1",
2929
"nw": "^0.31.5",
30-
"nw-builder": "^3.5.4",
30+
"nw-builder": "^3.5.6",
3131
"replace-in-file": "^3.4.2",
32-
"rimraf": "^2.6.2"
32+
"rimraf": "^2.6.3"
3333
},
3434
"scripts": {
3535
"build": "npm run build:third_party && npm run build:core",

src/ui/preview/preview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ cwc.ui.Preview = function(helper) {
9090
/** @private {!goog.events.EventTarget} */
9191
this.eventHandler_ = new goog.events.EventTarget();
9292

93-
/** @private {!Object.<number>} */
93+
/** @private {!Object.<number|null>} */
9494
this.eventTimer_ = {};
9595

9696
/** @private {boolean} */

src/ui/tour/tour.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ cwc.ui.Tour.prototype.getTourDescription = function() {
122122
return this.tourDescription_ || '';
123123
};
124124

125+
125126
/**
126127
* @return {Shepherd.Tour|boolean}
127128
*/
@@ -166,16 +167,18 @@ cwc.ui.Tour.prototype.clear = function() {
166167
this.tourLength_ = 0;
167168
};
168169

170+
169171
/**
170172
* @param {number} stepNumber
171173
* @param {number} tourLength
172-
* @param {function} cancel
173-
* @return {!array}
174+
* @param {Function} cancel
175+
* @return {!Array}
174176
* @private
175177
*/
176178
cwc.ui.Tour.prototype.getStepButtons = function(stepNumber, tourLength,
177179
cancel) {
178180
let tourButtons = [];
181+
179182
// Back button
180183
if (stepNumber > 0) {
181184
tourButtons.push({
@@ -205,6 +208,7 @@ cwc.ui.Tour.prototype.getStepButtons = function(stepNumber, tourLength,
205208
'classes': 'shepherd-button-example-primary',
206209
});
207210
}
211+
208212
// Next button
209213
if (stepNumber < tourLength - 1) {
210214
tourButtons.push({
@@ -219,9 +223,10 @@ cwc.ui.Tour.prototype.getStepButtons = function(stepNumber, tourLength,
219223
return tourButtons;
220224
};
221225

226+
222227
/**
223228
* @param {number} stepNumber
224-
* @return {!array}
229+
* @return {!Array}
225230
* @private
226231
*/
227232
cwc.ui.Tour.prototype.processButtons_ = function(stepNumber) {

src/ui/tutorial/tutorial.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ cwc.ui.Tutorial = function(helper) {
7575
/** @private {!string} */
7676
this.completedStepClass_ = this.prefix + 'step-container--complete';
7777

78-
/** @private {!Element} */
78+
/** @private {Element} */
7979
this.nodeMediaOverlay_ = null;
8080

81-
/** @private {!Element} */
81+
/** @private {Element} */
8282
this.nodeMediaOverlayClose_ = null;
8383

84-
/** @private {!Element} */
84+
/** @private {Element} */
8585
this.nodeMediaOverlayContent_ = null;
8686

8787
/** @private {!cwc.utils.Database} */
@@ -178,7 +178,7 @@ cwc.ui.Tutorial.prototype.hasTutorial = function() {
178178

179179

180180
/**
181-
* @param {!object} steps
181+
* @param {!Object} steps
182182
* @private
183183
*/
184184
cwc.ui.Tutorial.prototype.parseSteps_ = async function(steps) {
@@ -205,7 +205,7 @@ cwc.ui.Tutorial.prototype.parseSteps_ = async function(steps) {
205205

206206

207207
/**
208-
* @param {!object} stepTemplate
208+
* @param {!Object} stepTemplate
209209
* @param {!int} id
210210
* @private
211211
*/
@@ -265,7 +265,7 @@ cwc.ui.Tutorial.prototype.addStep_ = async function(stepTemplate, id) {
265265

266266
/**
267267
* @param {!string} key
268-
* @param {!object} data
268+
* @param {!Object} data
269269
* @param {boolean} warnOnOverwrite
270270
* @return {string|boolean}
271271
*/
@@ -311,7 +311,7 @@ cwc.ui.Tutorial.prototype.ensureUrlInDB_ =
311311

312312
/**
313313
* @param {!Array} source
314-
* @param {!object} destination
314+
* @param {!Object} destination
315315
* @param {!string} name
316316
* @return {!Promise}
317317
* @private
@@ -346,7 +346,7 @@ cwc.ui.Tutorial.prototype.appendBinaries_ =
346346

347347

348348
/**
349-
* @param {!object} spec
349+
* @param {!Object} spec
350350
* @return {!string|boolean}
351351
* @private
352352
*/
@@ -370,7 +370,7 @@ cwc.ui.Tutorial.prototype.ensureObjectInDb_ = async function(spec) {
370370

371371

372372
/**
373-
* @param {!object} description
373+
* @param {!Object} description
374374
* @private
375375
* @return {boolean}
376376
*/
@@ -395,7 +395,7 @@ cwc.ui.Tutorial.prototype.validateDescription_ = function(description) {
395395

396396

397397
/**
398-
* @param {!object} description
398+
* @param {!Object} description
399399
* @private
400400
* @return {string}
401401
*/

src/ui/tutorial/validator.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ cwc.ui.TutorialValidator.Type = {
3737
MATCH_TEXT_OUTPUT: 'match_text_output',
3838
};
3939

40+
4041
/**
4142
* @param {!cwc.utils.Helper} helper
4243
* @constructor
@@ -72,6 +73,7 @@ cwc.ui.TutorialValidator = function(helper) {
7273
this.running_ = false;
7374
};
7475

76+
7577
/**
7678
* Creates a validator webview/iframe with the same code as the preview and
7779
* runs validation code in it.
@@ -112,6 +114,7 @@ cwc.ui.TutorialValidator.prototype.start = function() {
112114
this.sandbox_['src'] = contentUrl;
113115
};
114116

117+
115118
/**
116119
* @return {string|null}
117120
* @private
@@ -139,6 +142,7 @@ cwc.ui.TutorialValidator.prototype.getValidate_ = function() {
139142
return validate;
140143
};
141144

145+
142146
/**
143147
* @param {string} textMatch
144148
* @param {string} message
@@ -164,6 +168,7 @@ cwc.ui.TutorialValidator.prototype.validateByMatchTextOutput_ =
164168
}
165169
};
166170

171+
167172
/**
168173
* @param {string} textOutput
169174
* @param {string} textMatch
@@ -185,9 +190,10 @@ cwc.ui.TutorialValidator.prototype.matchTextOutput_ = function(textOutput,
185190
this.processValidateResults_(result);
186191
};
187192

193+
188194
/**
189195
* Callback for validate.
190-
* @param {object} result
196+
* @param {Object} result
191197
* @private
192198
*/
193199
cwc.ui.TutorialValidator.prototype.processValidateResults_ = function(result) {
@@ -209,8 +215,8 @@ cwc.ui.TutorialValidator.prototype.processValidateResults_ = function(result) {
209215
/**
210216
* Injects code into an iframe/webview and handles the results.
211217
* @param {string} code
212-
* @param {any} expect
213-
* @param {int} timeout
218+
* @param {?} expect
219+
* @param {number} timeout
214220
* @private
215221
* @return {Promise}
216222
*/
@@ -245,7 +251,7 @@ cwc.ui.TutorialValidator.prototype.injectCode_ = function(code, expect,
245251

246252

247253
/**
248-
* Calls the appropriate function to run validatior code in sandbox
254+
* Calls the appropriate function to run validator code in sandbox
249255
* webview/iframe
250256
* @private
251257
*/
@@ -359,7 +365,7 @@ cwc.ui.TutorialValidator.prototype.callValidator_ = function() {
359365

360366
/**
361367
* Processes the results of the current step's validation function.
362-
* @param {Event} event
368+
* @param {?} event
363369
* @private
364370
*/
365371
cwc.ui.TutorialValidator.prototype.handleValidatorMessage_ = function(event) {
@@ -370,13 +376,12 @@ cwc.ui.TutorialValidator.prototype.handleValidatorMessage_ = function(event) {
370376
}
371377

372378
if (!this.running()) {
373-
this.log_.warn('Ignoring message', event,
374-
'because valiation isn\'t running');
379+
this.log_.warn('Ignoring message', event, 'validation isn\'t running');
375380
return;
376381
}
377382
if (!('source' in browserEvent) ||
378383
browserEvent['source'] !== this.sandbox_.contentWindow) {
379-
this.log_.warn('Ignoring message', browserEvent, 'because source isn\'t',
384+
this.log_.warn('Ignoring message', browserEvent, ' source isn\'t',
380385
this.sandbox_.contentWindow);
381386
return;
382387
}
@@ -386,19 +391,20 @@ cwc.ui.TutorialValidator.prototype.handleValidatorMessage_ = function(event) {
386391
this.processValidateResults_(browserEvent['data']['cwc-validate-result']);
387392
this.stop();
388393
} else {
389-
this.log_.info('Igorning unknown event', browserEvent);
394+
this.log_.info('Ignoring unknown event', browserEvent);
390395
}
391396
};
392397

393398

394399
/**
395-
* Determins if the script is running.
400+
* Determines if the script is running.
396401
* @return {boolean}
397402
*/
398403
cwc.ui.TutorialValidator.prototype.running = function() {
399404
return this.running_;
400405
};
401406

407+
402408
/**
403409
* Stops validation and cleans up events and sandbox.
404410
*/
@@ -411,6 +417,7 @@ cwc.ui.TutorialValidator.prototype.stop = function() {
411417
this.running_ = false;
412418
};
413419

420+
414421
/**
415422
* @param {!string} text
416423
* @return {!string}

src/utils/dialog/dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ cwc.utils.Dialog.prototype.isOpen = function(dialog) {
406406

407407

408408
/**
409-
* @return {!Element}
409+
* @return {Element}
410410
*/
411411
cwc.utils.Dialog.prototype.getCloseButton = function() {
412412
return goog.dom.getElement(this.prefix + 'close');

0 commit comments

Comments
 (0)