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

Unified Diff: sdk/lib/indexed_db/dartium/indexed_db_dartium.dart

Issue 15138002: Added tests to previously broken functionality and added null checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
Index: sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
diff --git a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
index 71b47ad1c982e43110ecfecc118cef4a3323ff82..bb76335e5df445b9f9229056490f5c0b8050aacf 100644
--- a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
+++ b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
@@ -189,13 +189,13 @@ class Database extends EventTarget {
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "IDBDatabase_removeEventListener_Callback";
Transaction transaction(storeName_OR_storeNames, String mode) {
- if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == null) && (mode is String || mode == null)) {
+ if (mode is String && storeName_OR_storeNames is List<String> && storeName_OR_storeNames != null) {
return _transaction_1(storeName_OR_storeNames, mode);
}
- if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == null) && (mode is String || mode == null)) {
+ if (mode is String && storeName_OR_storeNames is List<String> && storeName_OR_storeNames != null) {
return _transaction_2(storeName_OR_storeNames, mode);
}
- if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) && (mode is String || mode == null)) {
+ if (mode is String && storeName_OR_storeNames is String && storeName_OR_storeNames != null) {
return _transaction_3(storeName_OR_storeNames, mode);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -468,10 +468,10 @@ class Index extends NativeFieldWrapperClass1 {
bool get unique native "IDBIndex_unique_Getter";
Request $dom_count([key_OR_range]) {
- if ((key_OR_range is KeyRange || key_OR_range == null)) {
+ if (key_OR_range is KeyRange && key_OR_range != null) {
return _count_1(key_OR_range);
}
- if (?key_OR_range) {
+ if (?key_OR_range && key_OR_range != null) {
return _count_2(key_OR_range);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -482,10 +482,10 @@ class Index extends NativeFieldWrapperClass1 {
Request _count_2(key_OR_range) native "IDBIndex__count_2_Callback";
Request $dom_get(key) {
- if ((key is KeyRange || key == null)) {
+ if (key is KeyRange && key != null) {
return _get_1(key);
}
- if (?key) {
+ if (?key && key != null) {
return _get_2(key);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -496,10 +496,10 @@ class Index extends NativeFieldWrapperClass1 {
Request _get_2(key) native "IDBIndex__get_2_Callback";
Request $dom_getKey(key) {
- if ((key is KeyRange || key == null)) {
+ if (key is KeyRange && key != null) {
return _getKey_1(key);
}
- if (?key) {
+ if (?key && key != null) {
return _getKey_2(key);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -510,10 +510,10 @@ class Index extends NativeFieldWrapperClass1 {
Request _getKey_2(key) native "IDBIndex__getKey_2_Callback";
Request $dom_openCursor([key_OR_range, String direction]) {
- if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is String || direction == null)) {
+ if (direction is String && key_OR_range is KeyRange && key_OR_range != null) {
return _openCursor_1(key_OR_range, direction);
}
- if (?key_OR_range && (direction is String || direction == null)) {
+ if (direction is String && ?key_OR_range && key_OR_range != null) {
return _openCursor_2(key_OR_range, direction);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -524,10 +524,10 @@ class Index extends NativeFieldWrapperClass1 {
Request _openCursor_2(key_OR_range, direction) native "IDBIndex__openCursor_2_Callback";
Request $dom_openKeyCursor([key_OR_range, String direction]) {
- if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is String || direction == null)) {
+ if (direction is String && key_OR_range is KeyRange && key_OR_range != null) {
return _openKeyCursor_1(key_OR_range, direction);
}
- if (?key_OR_range && (direction is String || direction == null)) {
+ if (direction is String && ?key_OR_range && key_OR_range != null) {
return _openKeyCursor_2(key_OR_range, direction);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -768,10 +768,10 @@ class ObjectStore extends NativeFieldWrapperClass1 {
Request $dom_clear() native "IDBObjectStore_clear_Callback";
Request $dom_count([key_OR_range]) {
- if ((key_OR_range is KeyRange || key_OR_range == null)) {
+ if (key_OR_range is KeyRange && key_OR_range != null) {
return _count_1(key_OR_range);
}
- if (?key_OR_range) {
+ if (?key_OR_range && key_OR_range != null) {
return _count_2(key_OR_range);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -782,10 +782,10 @@ class ObjectStore extends NativeFieldWrapperClass1 {
Request _count_2(key_OR_range) native "IDBObjectStore__count_2_Callback";
Index $dom_createIndex(String name, keyPath, [Map options]) {
- if ((name is String || name == null) && (keyPath is List<String> || keyPath == null) && (options is Map || options == null)) {
+ if (options is Map && keyPath is List<String> && keyPath != null && name is String) {
return _createIndex_1(name, keyPath, options);
}
- if ((name is String || name == null) && (keyPath is String || keyPath == null) && (options is Map || options == null)) {
+ if (options is Map && keyPath is String && keyPath != null && name is String) {
return _createIndex_2(name, keyPath, options);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -796,10 +796,10 @@ class ObjectStore extends NativeFieldWrapperClass1 {
Index _createIndex_2(name, keyPath, options) native "IDBObjectStore__createIndex_2_Callback";
Request $dom_delete(key_OR_keyRange) {
- if ((key_OR_keyRange is KeyRange || key_OR_keyRange == null)) {
+ if (key_OR_keyRange is KeyRange && key_OR_keyRange != null) {
return _delete_1(key_OR_keyRange);
}
- if (?key_OR_keyRange) {
+ if (?key_OR_keyRange && key_OR_keyRange != null) {
return _delete_2(key_OR_keyRange);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -814,10 +814,10 @@ class ObjectStore extends NativeFieldWrapperClass1 {
void deleteIndex(String name) native "IDBObjectStore_deleteIndex_Callback";
Request $dom_get(key) {
- if ((key is KeyRange || key == null)) {
+ if (key is KeyRange && key != null) {
return _get_1(key);
}
- if (?key) {
+ if (?key && key != null) {
return _get_2(key);
}
throw new ArgumentError("Incorrect number or type of arguments");
@@ -832,10 +832,10 @@ class ObjectStore extends NativeFieldWrapperClass1 {
Index index(String name) native "IDBObjectStore_index_Callback";
Request $dom_openCursor([key_OR_range, String direction]) {
- if ((key_OR_range is KeyRange || key_OR_range == null) && (direction is String || direction == null)) {
+ if (direction is String && key_OR_range is KeyRange && key_OR_range != null) {
return _openCursor_1(key_OR_range, direction);
}
- if (?key_OR_range && (direction is String || direction == null)) {
+ if (direction is String && ?key_OR_range && key_OR_range != null) {
return _openCursor_2(key_OR_range, direction);
}
throw new ArgumentError("Incorrect number or type of arguments");

Powered by Google App Engine
This is Rietveld 408576698