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

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

Issue 11620004: Removed READ_ONLY constants from IDBTransaction class (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « sdk/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ed55ba159f4d2badd5caf0b3e4e3b86f44d6dbf7..50840443cb847c64d4ded5669d8e64b1579a915b 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -205,40 +205,15 @@ class Database extends EventTarget native "*IDBDatabase" {
// TODO(sra): Ensure storeName_OR_storeNames is a string or List<String>,
// and copy to JavaScript array if necessary.
- if (_transaction_fn != null) {
- return _transaction_fn(this, storeName_OR_storeNames, mode);
- }
-
// 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').
- var txn = _transaction(storeName_OR_storeNames, mode);
- if (_hasNumericMode(txn)) {
- _transaction_fn = _transaction_numeric_mode;
- txn = _transaction_fn(this, storeName_OR_storeNames, mode);
- } else {
- _transaction_fn = _transaction_string_mode;
- }
- return txn;
- }
-
- static Transaction _transaction_string_mode(Database db, stores, mode) {
- return db._transaction(stores, mode);
- }
-
- static Transaction _transaction_numeric_mode(Database db, stores, mode) {
- int intMode;
- if (mode == 'readonly') intMode = Transaction.READ_ONLY;
- if (mode == 'readwrite') intMode = Transaction.READ_WRITE;
- return db._transaction(stores, intMode);
+ return _transaction(storeName_OR_storeNames, mode);
}
@JSName('transaction')
Transaction _transaction(stores, mode) native;
- static bool _hasNumericMode(txn) =>
- JS('bool', 'typeof(#.mode) === "number"', txn);
-
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
DatabaseEvents get on =>
@@ -289,10 +264,6 @@ class Database extends EventTarget native "*IDBDatabase" {
VersionChangeRequest setVersion(String version) native;
}
-// TODO(sra): This should be a static member of IDBTransaction but dart2js
-// can't handle that. Move it back after dart2js is completely done.
-var _transaction_fn; // Assigned one of the static methods.
-
/// @docsEditable true
class DatabaseEvents extends Events {
/// @docsEditable true
« no previous file with comments | « sdk/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698