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

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

Issue 10910037: - Change "static final" to "static const" in the lib/coreimpl/ directory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | lib/coreimpl/dual_pivot_quicksort.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 4
5 class DateImplementation implements Date { 5 class DateImplementation implements Date {
6 final int millisecondsSinceEpoch; 6 final int millisecondsSinceEpoch;
7 final bool isUtc; 7 final bool isUtc;
8 8
9 factory DateImplementation.fromString(String formattedString) { 9 factory DateImplementation.fromString(String formattedString) {
10 // Read in (a subset of) ISO 8601. 10 // Read in (a subset of) ISO 8601.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 if (millisecondsSinceEpoch === null) { 52 if (millisecondsSinceEpoch === null) {
53 throw new IllegalArgumentException(formattedString); 53 throw new IllegalArgumentException(formattedString);
54 } 54 }
55 if (addOneMillisecond) millisecondsSinceEpoch++; 55 if (addOneMillisecond) millisecondsSinceEpoch++;
56 return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, isUtc); 56 return new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, isUtc);
57 } else { 57 } else {
58 throw new IllegalArgumentException(formattedString); 58 throw new IllegalArgumentException(formattedString);
59 } 59 }
60 } 60 }
61 61
62 static final int _MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; 62 static const int _MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000;
63 63
64 DateImplementation.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch, 64 DateImplementation.fromMillisecondsSinceEpoch(this.millisecondsSinceEpoch,
65 [this.isUtc = false]) { 65 [this.isUtc = false]) {
66 if (millisecondsSinceEpoch.abs() > _MAX_MILLISECONDS_SINCE_EPOCH) { 66 if (millisecondsSinceEpoch.abs() > _MAX_MILLISECONDS_SINCE_EPOCH) {
67 throw new IllegalArgumentException(millisecondsSinceEpoch); 67 throw new IllegalArgumentException(millisecondsSinceEpoch);
68 } 68 }
69 if (isUtc === null) throw new IllegalArgumentException(isUtc); 69 if (isUtc === null) throw new IllegalArgumentException(isUtc);
70 } 70 }
71 71
72 bool operator ==(other) { 72 bool operator ==(other) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 external Duration get timeZoneOffset(); 175 external Duration get timeZoneOffset();
176 external int get year(); 176 external int get year();
177 external int get month(); 177 external int get month();
178 external int get day(); 178 external int get day();
179 external int get hour(); 179 external int get hour();
180 external int get minute(); 180 external int get minute();
181 external int get second(); 181 external int get second();
182 external int get millisecond(); 182 external int get millisecond();
183 external int get weekday(); 183 external int get weekday();
184 } 184 }
OLDNEW
« no previous file with comments | « no previous file | lib/coreimpl/dual_pivot_quicksort.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698