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

Unified Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.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/html/dartium/html_dartium.dart ('k') | sdk/lib/indexed_db/dartium/indexed_db_dartium.dart » ('j') | 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 a69b9bcb6c8932d93ab7dedf85fba90bedac178e..65ebfc67ea3b1a0ac0edd31b439c9e444b1b780a 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -635,7 +635,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;
@@ -1186,7 +1187,7 @@ class ObjectStore extends Interceptor {
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 {
@@ -1199,6 +1200,9 @@ class ObjectStore extends Interceptor {
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/html/dartium/html_dartium.dart ('k') | sdk/lib/indexed_db/dartium/indexed_db_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698