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

Unified Diff: chrome/browser/resources/print_preview/print_preview_utils.js

Issue 575333002: Compile print_preview, part 2: reduce down to 260 errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@I_print_preview
Patch Set: revert movement of enums: now handle in compiler pass Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/print_preview_utils.js
diff --git a/chrome/browser/resources/print_preview/print_preview_utils.js b/chrome/browser/resources/print_preview/print_preview_utils.js
index a878d8687e5718a71b6003482b48c140282d4d45..7f39003f9d6db0c653b66201b670790efcc14c06 100644
--- a/chrome/browser/resources/print_preview/print_preview_utils.js
+++ b/chrome/browser/resources/print_preview/print_preview_utils.js
@@ -56,8 +56,8 @@ function areRangesEqual(array1, array2) {
/**
* Removes duplicate elements from |inArray| and returns a new array.
* |inArray| is not affected. It assumes that |inArray| is already sorted.
- * @param {Array.<number>} inArray The array to be processed.
- * @return {Array.<number>} The array after processing.
+ * @param {!Array.<number>} inArray The array to be processed.
+ * @return {!Array.<number>} The array after processing.
*/
function removeDuplicates(inArray) {
var out = [];
@@ -93,16 +93,17 @@ function removeDuplicates(inArray) {
* Example: "-" is valid, assuming |totalPageCount| >= 1.
* Example: "1-4dsf, 11" is invalid regardless of |totalPageCount|.
* @param {string} pageRangeText The text to be checked.
- * @param {number} totalPageCount The total number of pages.
+ * @param {number=} opt_totalPageCount The total number of pages.
* @return {Array.<{from: number, to: number}>} An array of page range objects.
*/
-function pageRangeTextToPageRanges(pageRangeText, totalPageCount) {
+function pageRangeTextToPageRanges(pageRangeText, opt_totalPageCount) {
if (pageRangeText == '') {
return [];
}
var MAX_PAGE_NUMBER = 1000000000;
- totalPageCount = totalPageCount ? totalPageCount : MAX_PAGE_NUMBER;
+ var totalPageCount = opt_totalPageCount ? opt_totalPageCount :
+ MAX_PAGE_NUMBER;
var regex = /^\s*([0-9]*)\s*-\s*([0-9]*)\s*$/;
var parts = pageRangeText.split(/,/);
@@ -161,8 +162,8 @@ function pageRangeTextToPageList(pageRangeText, totalPageCount) {
}
/**
- * @param {Array.<number>} pageList The list to be processed.
- * @return {Array.<number>} The contents of |pageList| in ascending order and
+ * @param {!Array.<number>} pageList The list to be processed.
+ * @return {!Array.<number>} The contents of |pageList| in ascending order and
* without any duplicates. |pageList| is not affected.
*/
function pageListToPageSet(pageList) {
« no previous file with comments | « chrome/browser/resources/print_preview/print_preview_focus_manager.js ('k') | ui/webui/resources/js/cr/event_target.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698