Chromium Code Reviews| Index: runtime/bin/http_utils.dart |
| diff --git a/runtime/bin/http_utils.dart b/runtime/bin/http_utils.dart |
| index f283128dfe11b52307c78470c2f2779baf5b63d0..059577e2455656dfedc2348203bb5bb613887afd 100644 |
| --- a/runtime/bin/http_utils.dart |
| +++ b/runtime/bin/http_utils.dart |
| @@ -94,9 +94,9 @@ class _HttpUtils { |
| // Format as RFC 1123 date. |
| static String formatDate(Date date) { |
| - List wkday = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; |
| - List month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; |
| + List wkday = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; |
|
Mads Ager (google)
2012/09/05 08:52:51
Mark the wkday as const as well?
const List wkday
Anders Johnsen
2012/09/05 09:09:46
Got'ya, done.
|
| + List month = const ["Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; |
| Date d = date.toUtc(); |
| StringBuffer sb = new StringBuffer(); |
| @@ -119,16 +119,17 @@ class _HttpUtils { |
| static Date parseDate(String date) { |
| final int SP = 32; |
| - List wkdays = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; |
| - List weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", |
| - "Friday", "Saturday", "Sunday"]; |
| - List months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; |
| - List wkdaysLowerCase = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]; |
| - List weekdaysLowerCase = ["monday", "tuesday", "wednesday", "thursday", |
| - "friday", "saturday", "sunday"]; |
| - List monthsLowerCase = ["jan", "feb", "mar", "apr", "may", "jun", |
| - "jul", "aug", "sep", "oct", "nov", "dec"]; |
| + List wkdays = const ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; |
| + List weekdays = const ["Monday", "Tuesday", "Wednesday", "Thursday", |
| + "Friday", "Saturday", "Sunday"]; |
| + List months = const ["Jan", "Feb", "Mar", "Apr", "May", "Jun", |
| + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; |
| + List wkdaysLowerCase = |
| + const ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]; |
| + List weekdaysLowerCase = const ["monday", "tuesday", "wednesday", |
| + "thursday", "friday", "saturday", "sunday"]; |
| + List monthsLowerCase = const ["jan", "feb", "mar", "apr", "may", "jun", |
| + "jul", "aug", "sep", "oct", "nov", "dec"]; |
| final int formatRfc1123 = 0; |
| final int formatRfc850 = 1; |
| @@ -244,8 +245,8 @@ class _HttpUtils { |
| } |
| static Date parseCookieDate(String date) { |
| - List monthsLowerCase = ["jan", "feb", "mar", "apr", "may", "jun", |
| - "jul", "aug", "sep", "oct", "nov", "dec"]; |
| + List monthsLowerCase = const ["jan", "feb", "mar", "apr", "may", "jun", |
| + "jul", "aug", "sep", "oct", "nov", "dec"]; |
| int position = 0; |
| @@ -326,7 +327,9 @@ class _HttpUtils { |
| } |
| if (timeStr === null || dayOfMonthStr === null || |
| - monthStr === null || yearStr === null) error(); |
| + monthStr === null || yearStr === null) { |
| + error(); |
| + } |
| int year = toInt(yearStr); |
| if (year >= 70 && year <= 99) year += 1900; |