Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/speech_rules/store_util.js

Issue 924083004: Shorten Closure template notation from Array.<*> to Array<*> in cvox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview General utility functions for rule stores. 6 * @fileoverview General utility functions for rule stores.
7 */ 7 */
8 8
9 goog.provide('cvox.StoreUtil'); 9 goog.provide('cvox.StoreUtil');
10 10
11 11
12 /** 12 /**
13 * Count list of nodes and concatenate this with the context string. 13 * Count list of nodes and concatenate this with the context string.
14 * Returns a closure with a local state. 14 * Returns a closure with a local state.
15 * @param {Array.<Node>} nodes A node array. 15 * @param {Array<Node>} nodes A node array.
16 * @param {?string} context A context string. 16 * @param {?string} context A context string.
17 * @return {function(): string} A function returning a string. 17 * @return {function(): string} A function returning a string.
18 */ 18 */
19 cvox.StoreUtil.nodeCounter = function(nodes, context) { 19 cvox.StoreUtil.nodeCounter = function(nodes, context) {
20 // Local state. 20 // Local state.
21 var localLength = nodes.length; 21 var localLength = nodes.length;
22 var localCounter = 0; 22 var localCounter = 0;
23 var localContext = context; 23 var localContext = context;
24 if (!context) { 24 if (!context) {
25 localContext = ''; 25 localContext = '';
26 } 26 }
27 return function() { 27 return function() {
28 if (localCounter < localLength) { 28 if (localCounter < localLength) {
29 localCounter += 1; 29 localCounter += 1;
30 } 30 }
31 return localContext + ' ' + localCounter; 31 return localContext + ' ' + localCounter;
32 }; 32 };
33 }; 33 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698