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

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

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. Created 8 years, 2 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
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 // Dart core library. 4 // Dart core library.
5 5
6 // VM implementation of DateImplementation. 6 // VM implementation of DateImplementation.
7 patch class DateImplementation { 7 patch class DateImplementation {
8 /* patch */ DateImplementation(int year, 8 /* patch */ DateImplementation(int year,
9 [int month = 1, 9 [int month = 1,
10 int day = 1, 10 int day = 1,
11 int hour = 0, 11 int hour = 0,
12 int minute = 0, 12 int minute = 0,
13 int second = 0, 13 int second = 0,
14 int millisecond = 0, 14 int millisecond = 0,
15 bool isUtc = false]) 15 bool isUtc = false])
16 : this.isUtc = isUtc, 16 : this.isUtc = isUtc,
17 this.millisecondsSinceEpoch = _brokenDownDateToMillisecondsSinceEpoch( 17 this.millisecondsSinceEpoch = _brokenDownDateToMillisecondsSinceEpoch(
18 year, month, day, hour, minute, second, millisecond, isUtc) { 18 year, month, day, hour, minute, second, millisecond, isUtc) {
19 if (millisecondsSinceEpoch === null) throw new IllegalArgumentException(); 19 if (millisecondsSinceEpoch === null) throw new ArgumentError();
20 if (isUtc === null) throw new IllegalArgumentException(); 20 if (isUtc === null) throw new ArgumentError();
21 } 21 }
22 22
23 /* patch */ DateImplementation.now() 23 /* patch */ DateImplementation.now()
24 : isUtc = false, 24 : isUtc = false,
25 millisecondsSinceEpoch = _getCurrentMs() { 25 millisecondsSinceEpoch = _getCurrentMs() {
26 } 26 }
27 27
28 /* patch */ String get timeZoneName { 28 /* patch */ String get timeZoneName {
29 if (isUtc) return "UTC"; 29 if (isUtc) return "UTC";
30 return _timeZoneName(millisecondsSinceEpoch); 30 return _timeZoneName(millisecondsSinceEpoch);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch) 316 static String _timeZoneNameForClampedSeconds(int secondsSinceEpoch)
317 native "DateNatives_timeZoneName"; 317 native "DateNatives_timeZoneName";
318 318
319 static int _timeZoneOffsetInSecondsForClampedSeconds(int secondsSinceEpoch) 319 static int _timeZoneOffsetInSecondsForClampedSeconds(int secondsSinceEpoch)
320 native "DateNatives_timeZoneOffsetInSeconds"; 320 native "DateNatives_timeZoneOffsetInSeconds";
321 321
322 static int _localTimeZoneAdjustmentInSeconds() 322 static int _localTimeZoneAdjustmentInSeconds()
323 native "DateNatives_localTimeZoneAdjustmentInSeconds"; 323 native "DateNatives_localTimeZoneAdjustmentInSeconds";
324 } 324 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698