| Index: tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate b/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
|
| index 180b2b0555e9976f73af7fc64411c9bce45e9350..39e9d30cc0eb39b2848f93b7df87e2afa685d493 100644
|
| --- a/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_IDBTransaction.darttemplate
|
| @@ -16,16 +16,22 @@ $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| Future<Database> get completed {
|
| var completer = new Completer<Database>();
|
|
|
| + var errored = false;
|
| +
|
| this.onComplete.first.then((_) {
|
| completer.complete(db);
|
| });
|
|
|
| this.onError.first.then((e) {
|
| + errored = true;
|
| completer.completeError(e);
|
| });
|
|
|
| this.onAbort.first.then((e) {
|
| - completer.completeError(e);
|
| + // Avoid completing twice if an error occurs.
|
| + if (!errored) {
|
| + completer.completeError(e);
|
| + }
|
| });
|
|
|
| return completer.future;
|
|
|