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

Unified Diff: lib/transformations/continuation.dart

Issue 2465163004: Support both older and newer implementations of dart:async. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/transformations/continuation.dart
diff --git a/lib/transformations/continuation.dart b/lib/transformations/continuation.dart
index 821933b03ef6ef68e2b4197a802efbe067201c49..eebd307c7bf69449de5f4f8352e64396f566db17 100644
--- a/lib/transformations/continuation.dart
+++ b/lib/transformations/continuation.dart
@@ -863,7 +863,21 @@ class HelperNodes {
var completerClass = findClass(asyncLibrary, 'Completer');
var futureClass = findClass(asyncLibrary, 'Future');
- var streamIteratorClass = findClass(asyncLibrary, '_StreamIterator');
+
+ // The VM's dart:async implementation has renamed _StreamIteratorImpl to
+ // _StreamIterator. To support both old and new library implementations we
+ // look for the old name first and then the new name.
+ var streamIteratorClass;
+ try {
+ streamIteratorClass = findClass(asyncLibrary, '_StreamIteratorImpl');
+ } catch (e) {
+ if (e == 'Class "_StreamIteratorImpl" not found') {
+ streamIteratorClass = findClass(asyncLibrary, '_StreamIterator');
+ } else {
+ rethrow;
+ }
+ }
+
var syncIterableClass = findClass(coreLibrary, '_SyncIterable');
var streamControllerClass =
findClass(asyncLibrary, '_AsyncStarStreamController');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698