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

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

Issue 1914583002: Use _downcast and _cast instead of "as" to reduce dart2js output size. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart ('k') | tools/dom/src/WrappedList.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8264525643cd413cd427ac84c53c680de7a30958..584abb03622b8f37360c6e6ba4bf75bc76db0559 100644
--- a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
+++ b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
@@ -579,7 +579,8 @@ Future/*<T>*/ _completeRequest/*<T>*/(Request request) {
// TODO: make sure that completer.complete is synchronous as transactions
// may be committed if the result is not processed immediately.
request.onSuccess.listen((e) {
- completer.complete(request.result as dynamic/*=T*/);
+ var result = _cast/*<T>*/(request.result);
+ completer.complete(result);
});
request.onError.listen(completer.completeError);
return completer.future;
@@ -1086,7 +1087,7 @@ class ObjectStore extends DartHtmlDomObject {
request.onError.listen(controller.addError);
request.onSuccess.listen((e) {
- var cursor = request.result as dynamic /*=T*/;
+ var cursor = _cast/*<T>*/(request.result);
if (cursor == null) {
controller.close();
} else {
@@ -1099,6 +1100,9 @@ class ObjectStore extends DartHtmlDomObject {
return controller.stream;
}
}
+
+// ignore: STRONG_MODE_DOWN_CAST_COMPOSITE
+/*=To*/ _cast/*<To>*/(dynamic x) => x;
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
« no previous file with comments | « sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart ('k') | tools/dom/src/WrappedList.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698