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

Side by Side Diff: tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 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 4
5 // DO NOT EDIT 5 // DO NOT EDIT
6 // Auto-generated dart:svg library. 6 // Auto-generated dart:svg library.
7 7
8 library indexed_db; 8 library indexed_db;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 containsDate(object) { 90 containsDate(object) {
91 if (isJavaScriptDate(object)) return true; 91 if (isJavaScriptDate(object)) return true;
92 if (object is List) { 92 if (object is List) {
93 for (int i = 0; i < object.length; i++) { 93 for (int i = 0; i < object.length; i++) {
94 if (containsDate(object[i])) return true; 94 if (containsDate(object[i])) return true;
95 } 95 }
96 } 96 }
97 return false; // number, string. 97 return false; // number, string.
98 } 98 }
99 if (containsDate(nativeKey)) { 99 if (containsDate(nativeKey)) {
100 throw new UnimplementedError('Key containing Date'); 100 throw new UnimplementedError('Key containing DateTime');
101 } 101 }
102 // TODO: Cache conversion somewhere? 102 // TODO: Cache conversion somewhere?
103 return nativeKey; 103 return nativeKey;
104 } 104 }
105 105
106 /** 106 /**
107 * Converts a Dart object into a valid IDBKey. 107 * Converts a Dart object into a valid IDBKey.
108 * 108 *
109 * May return the original input. Does not mutate input. 109 * May return the original input. Does not mutate input.
110 * 110 *
111 * If necessary, [dartKey] may be copied to ensure all lists are converted into 111 * If necessary, [dartKey] may be copied to ensure all lists are converted into
112 * JavaScript Arrays and Dart Dates into JavaScript Dates. 112 * JavaScript Arrays and Dart Dates into JavaScript Dates.
113 */ 113 */
114 _convertDartToNative_IDBKey(dartKey) { 114 _convertDartToNative_IDBKey(dartKey) {
115 // TODO: Implement. 115 // TODO: Implement.
116 return dartKey; 116 return dartKey;
117 } 117 }
118 118
119 119
120 120
121 /// May modify original. If so, action is idempotent. 121 /// May modify original. If so, action is idempotent.
122 _convertNativeToDart_IDBAny(object) { 122 _convertNativeToDart_IDBAny(object) {
123 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false); 123 return convertNativeToDart_AcceptStructuredClone(object, mustCopy: false);
124 } 124 }
125 125
126 126
127 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add Date. 127 const String _idbKey = '=List|=Object|num|String'; // TODO(sra): Add DateTime.
128 const _annotation_Creates_IDBKey = const Creates(_idbKey); 128 const _annotation_Creates_IDBKey = const Creates(_idbKey);
129 const _annotation_Returns_IDBKey = const Returns(_idbKey); 129 const _annotation_Returns_IDBKey = const Returns(_idbKey);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698