Chromium Code Reviews

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

Issue 11361190: a === b -> identical(a, b) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 80chars. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | 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 _DateImpl. 6 // VM implementation of _DateImpl.
7 patch class _DateImpl { 7 patch class _DateImpl {
8 /* patch */ _DateImpl(int year, 8 /* patch */ _DateImpl(int year,
9 int month, 9 int month,
10 int day, 10 int day,
11 int hour, 11 int hour,
12 int minute, 12 int minute,
13 int second, 13 int second,
14 int millisecond, 14 int millisecond,
15 bool isUtc) 15 bool isUtc)
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 ArgumentError(); 19 if (millisecondsSinceEpoch == null) throw new ArgumentError();
20 if (isUtc === null) throw new ArgumentError(); 20 if (isUtc == null) throw new ArgumentError();
21 } 21 }
22 22
23 /* patch */ _DateImpl.now() 23 /* patch */ _DateImpl.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...)
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