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

Side by Side Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Issue 12177007: Make mode argument optional for IDB transaction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | tests/html/indexeddb_1_test.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 library dart.dom.indexed_db; 1 library dart.dom.indexed_db;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:html'; 4 import 'dart:html';
5 import 'dart:html_common'; 5 import 'dart:html_common';
6 import 'dart:_js_helper' show Creates, Returns, JSName, Null; 6 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
7 import 'dart:_foreign_helper' show JS; 7 import 'dart:_foreign_helper' show JS;
8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 8 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9 // for details. All rights reserved. Use of this source code is governed by a 9 // for details. All rights reserved. Use of this source code is governed by a
10 // BSD-style license that can be found in the LICENSE file. 10 // BSD-style license that can be found in the LICENSE file.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // BSD-style license that can be found in the LICENSE file. 199 // BSD-style license that can be found in the LICENSE file.
200 200
201 201
202 @DomName('IDBDatabase') 202 @DomName('IDBDatabase')
203 @SupportedBrowser(SupportedBrowser.CHROME) 203 @SupportedBrowser(SupportedBrowser.CHROME)
204 @SupportedBrowser(SupportedBrowser.FIREFOX, '15') 204 @SupportedBrowser(SupportedBrowser.FIREFOX, '15')
205 @SupportedBrowser(SupportedBrowser.IE, '10') 205 @SupportedBrowser(SupportedBrowser.IE, '10')
206 @Experimental 206 @Experimental
207 class Database extends EventTarget native "*IDBDatabase" { 207 class Database extends EventTarget native "*IDBDatabase" {
208 208
209 Transaction transaction(storeName_OR_storeNames, String mode) { 209 Transaction transaction(storeName_OR_storeNames, {String mode}) {
210 if (mode == null) mode = 'readonly';
210 if (mode != 'readonly' && mode != 'readwrite') { 211 if (mode != 'readonly' && mode != 'readwrite') {
211 throw new ArgumentError(mode); 212 throw new ArgumentError(mode);
212 } 213 }
213 214
214 // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>, 215 // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
215 // and copy to JavaScript array if necessary. 216 // and copy to JavaScript array if necessary.
216 217
217 // Try and create a transaction with a string mode. Browsers that expect a 218 // Try and create a transaction with a string mode. Browsers that expect a
218 // numeric mode tend to convert the string into a number. This fails 219 // numeric mode tend to convert the string into a number. This fails
219 // silently, resulting in zero ('readonly'). 220 // silently, resulting in zero ('readonly').
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 } 926 }
926 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 927 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
927 // for details. All rights reserved. Use of this source code is governed by a 928 // for details. All rights reserved. Use of this source code is governed by a
928 // BSD-style license that can be found in the LICENSE file. 929 // BSD-style license that can be found in the LICENSE file.
929 930
930 931
931 @DocsEditable 932 @DocsEditable
932 @DomName('IDBAny') 933 @DomName('IDBAny')
933 class _IDBAny native "*IDBAny" { 934 class _IDBAny native "*IDBAny" {
934 } 935 }
OLDNEW
« no previous file with comments | « no previous file | tests/html/indexeddb_1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698