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

Side by Side Diff: runtime/lib/date.dart

Issue 10383238: Fix tests in language suite: eliminate String + (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/builtin.dart ('k') | tests/language/call_through_null_getter_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // Dart core library. 4 // Dart core library.
5 5
6 class TimeZoneImplementation implements TimeZone { 6 class TimeZoneImplementation implements TimeZone {
7 const TimeZoneImplementation.utc() : isUtc = true; 7 const TimeZoneImplementation.utc() : isUtc = true;
8 TimeZoneImplementation.local() : isUtc = false {} 8 TimeZoneImplementation.local() : isUtc = false {}
9 9
10 bool operator ==(Object other) { 10 bool operator ==(Object other) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // Read in (a subset of) ISO 8601. 54 // Read in (a subset of) ISO 8601.
55 // Examples: 55 // Examples:
56 // - "2012-02-27 13:27:00" 56 // - "2012-02-27 13:27:00"
57 // - "2012-02-27 13:27:00.423z" 57 // - "2012-02-27 13:27:00.423z"
58 // - "20120227 13:27:00" 58 // - "20120227 13:27:00"
59 // - "20120227T132700" 59 // - "20120227T132700"
60 // - "20120227" 60 // - "20120227"
61 // - "2012-02-27T14Z" 61 // - "2012-02-27T14Z"
62 // - "-123450101 00:00:00 Z" // In the year -12345. 62 // - "-123450101 00:00:00 Z" // In the year -12345.
63 final RegExp re = const RegExp( 63 final RegExp re = const RegExp(
64 @'^([+-]?\d?\d\d\d\d)-?(\d\d)-?(\d\d)' + // The day part. 64 @'^([+-]?\d?\d\d\d\d)-?(\d\d)-?(\d\d)' // The day part.
65 @'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(.\d{1,6})?)?)? ?([zZ])?)?$'); 65 @'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(.\d{1,6})?)?)? ?([zZ])?)?$');
66 Match match = re.firstMatch(formattedString); 66 Match match = re.firstMatch(formattedString);
67 if (match !== null) { 67 if (match !== null) {
68 int parseIntOrZero(String matched) { 68 int parseIntOrZero(String matched) {
69 // TODO(floitsch): we should not need to test against the empty string. 69 // TODO(floitsch): we should not need to test against the empty string.
70 if (matched === null || matched == "") return 0; 70 if (matched === null || matched == "") return 0;
71 return Math.parseInt(matched); 71 return Math.parseInt(matched);
72 } 72 }
73 73
74 double parseDoubleOrZero(String matched) { 74 double parseDoubleOrZero(String matched) {
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 static int _getHours(int secondsSinceEpoch, bool isUtc) 415 static int _getHours(int secondsSinceEpoch, bool isUtc)
416 native "DateNatives_getHours"; 416 native "DateNatives_getHours";
417 417
418 static int _getMinutes(int secondsSinceEpoch, bool isUtc) 418 static int _getMinutes(int secondsSinceEpoch, bool isUtc)
419 native "DateNatives_getMinutes"; 419 native "DateNatives_getMinutes";
420 420
421 static int _getSeconds(int secondsSinceEpoch, bool isUtc) 421 static int _getSeconds(int secondsSinceEpoch, bool isUtc)
422 native "DateNatives_getSeconds"; 422 native "DateNatives_getSeconds";
423 } 423 }
OLDNEW
« no previous file with comments | « runtime/bin/builtin.dart ('k') | tests/language/call_through_null_getter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698