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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 17574008: Fixing DateTime values in dart2js serialized script values. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/html/html_common/conversions.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index ebefdfc6a08663990d5af56637aefb2aa32ce64e..6ec604495e2d8ea75c78d5c5d0347696cdbf3113 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -10225,7 +10225,7 @@ class FieldSetElement extends _HTMLElement native "HTMLFieldSetElement" {
@DomName('File')
class File extends Blob native "File" {
- DateTime get lastModifiedDate => _convertNativeToDart_DateTime(this._get_lastModifiedDate);
+ DateTime get lastModifiedDate => convertNativeToDart_DateTime(this._get_lastModifiedDate);
@JSName('lastModifiedDate')
@DomName('File.lastModifiedDate')
@DocsEditable
@@ -12748,7 +12748,7 @@ class InputElement extends _HTMLElement implements
@DocsEditable
String value;
- DateTime get valueAsDate => _convertNativeToDart_DateTime(this._get_valueAsDate);
+ DateTime get valueAsDate => convertNativeToDart_DateTime(this._get_valueAsDate);
@JSName('valueAsDate')
@DomName('HTMLInputElement.valueAsDate')
@DocsEditable
@@ -12756,7 +12756,7 @@ class InputElement extends _HTMLElement implements
final dynamic _get_valueAsDate;
void set valueAsDate(DateTime value) {
- this._set_valueAsDate = _convertDartToNative_DateTime(value);
+ this._set_valueAsDate = convertDartToNative_DateTime(value);
}
void set _set_valueAsDate(/*dynamic*/ value) {
JS("void", "#.valueAsDate = #", this, value);
@@ -15243,7 +15243,7 @@ class MetaElement extends _HTMLElement native "HTMLMetaElement" {
@Experimental
class Metadata native "Metadata" {
- DateTime get modificationTime => _convertNativeToDart_DateTime(this._get_modificationTime);
+ DateTime get modificationTime => convertNativeToDart_DateTime(this._get_modificationTime);
@JSName('modificationTime')
@DomName('Metadata.modificationTime')
@DocsEditable
@@ -19041,7 +19041,7 @@ class RtcStatsReport native "RTCStatsReport" {
@DocsEditable
final RtcStatsReport remote;
- DateTime get timestamp => _convertNativeToDart_DateTime(this._get_timestamp);
+ DateTime get timestamp => convertNativeToDart_DateTime(this._get_timestamp);
@JSName('timestamp')
@DomName('RTCStatsReport.timestamp')
@DocsEditable
@@ -29195,15 +29195,6 @@ class _WrappedIterator<E> implements Iterator<E> {
// window as a parameter.
-DateTime _convertNativeToDart_DateTime(date) {
- var millisSinceEpoch = JS('int', '#.getTime()', date);
- return new DateTime.fromMillisecondsSinceEpoch(millisSinceEpoch, isUtc: true);
-}
-
-_convertDartToNative_DateTime(DateTime date) {
- return JS('', 'new Date(#)', date.millisecondsSinceEpoch);
-}
-
WindowBase _convertNativeToDart_Window(win) {
if (win == null) return null;
return _DOMWindowCrossFrame._createSafe(win);
« no previous file with comments | « no previous file | sdk/lib/html/html_common/conversions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698