Index: ui/webui/resources/js/load_time_data.js |
diff --git a/ui/webui/resources/js/load_time_data.js b/ui/webui/resources/js/load_time_data.js |
index 33b388094bc5cbdd3af870c9eef9c531af814f29..d7f99e161a251e3df8eabe38cc7f9f63cadf6d16 100644 |
--- a/ui/webui/resources/js/load_time_data.js |
+++ b/ui/webui/resources/js/load_time_data.js |
@@ -12,12 +12,14 @@ |
var loadTimeData; |
+// Expose this type globally as a temporary work around until |
+// https://github.com/google/closure-compiler/issues/544 is fixed. |
+/** @constructor */ |
+function LoadTimeData() {} |
+ |
(function() { |
'use strict'; |
- function LoadTimeData() { |
- } |
- |
LoadTimeData.prototype = { |
/** |
* Sets the backing object. |
@@ -29,6 +31,7 @@ var loadTimeData; |
}, |
/** |
+ * @param {string} id An ID of a value that might exist. |
* @return {boolean} True if |id| is a key in the dictionary. |
*/ |
valueExists: function(id) { |
@@ -55,20 +58,21 @@ var loadTimeData; |
getString: function(id) { |
var value = this.getValue(id); |
expectIsType(id, value, 'string'); |
- return value; |
+ return /** @type {string} */ (value); |
}, |
/** |
* Returns a formatted localized string where $1 to $9 are replaced by the |
* second to the tenth argument. |
* @param {string} id The ID of the string we want. |
- * @param {...string} The extra values to include in the formatted output. |
+ * @param {...string} var_args The extra values to include in the formatted |
+ * output. |
* @return {string} The formatted string. |
*/ |
- getStringF: function(id) { |
+ getStringF: function(id, var_args) { |
var value = this.getString(id); |
if (!value) |
- return; |
+ return ''; |
var varArgs = arguments; |
return value.replace(/\$[$1-9]/g, function(m) { |
@@ -84,7 +88,7 @@ var loadTimeData; |
getBoolean: function(id) { |
var value = this.getValue(id); |
expectIsType(id, value, 'boolean'); |
- return value; |
+ return /** @type {boolean} */ (value); |
}, |
/** |
@@ -96,7 +100,7 @@ var loadTimeData; |
var value = this.getValue(id); |
expectIsType(id, value, 'number'); |
expect(value == Math.floor(value), 'Number isn\'t integer: ' + value); |
- return value; |
+ return /** @type {number} */ (value); |
}, |
/** |