Chromium Code Reviews

Unified Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart

Issue 16494002: Expand overloaded methods and optional parameters in the html library. (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.
Jump to:
View side-by-side diff with in-line comments
Index: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
index ee98234579ad00979b9b4a21919b86f7cbef5fdf..142b3a98bd5296cf46a16b5475c7e61984482094 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -249,18 +249,29 @@ class Database extends EventTarget native "IDBDatabase" {
return $dom_createObjectStore(name, options);
}
- Transaction transaction(storeName_OR_storeNames, String mode) {
+ Transaction transaction(String storeName, String mode) {
if (mode != 'readonly' && mode != 'readwrite') {
throw new ArgumentError(mode);
}
-
- // TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
- // and copy to JavaScript array if necessary.
-
// Try and create a transaction with a string mode. Browsers that expect a
// numeric mode tend to convert the string into a number. This fails
// silently, resulting in zero ('readonly').
- return _transaction(storeName_OR_storeNames, mode);
+ return _transaction(storeName, mode);
+ }
+
+ Transaction transactionList(List<String> storeNames, String mode) {
+ if (mode != 'readonly' && mode != 'readwrite') {
+ throw new ArgumentError(mode);
+ }
+ List storeNames_1 = convertDartToNative_StringArray(storeNames);
+ return _transaction(storeNames_1, mode);
+ }
+
+ Transaction transactionStringList(DomStringList storeNames, String mode) {
+ if (mode != 'readonly' && mode != 'readwrite') {
+ throw new ArgumentError(mode);
+ }
+ return _transaction(storeNames_1, mode);
}
@JSName('transaction')

Powered by Google App Engine