Index: pkg/compiler/lib/src/js_backend/backend.dart |
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
index 88140e3292a3c3f2cfb8822ffb19de27e3376403..175bb05e3f08155acaf1c967cc3cb68faec2bf0f 100644 |
--- a/pkg/compiler/lib/src/js_backend/backend.dart |
+++ b/pkg/compiler/lib/src/js_backend/backend.dart |
@@ -235,8 +235,8 @@ class JavaScriptBackend extends Backend { |
new Uri(scheme: 'dart', path: '_js_embedded_names'); |
static final Uri DART_ISOLATE_HELPER = |
new Uri(scheme: 'dart', path: '_isolate_helper'); |
- static final Uri DART_HTML = |
- new Uri(scheme: 'dart', path: 'html'); |
+ static final Uri DART_ASYNC = new Uri(scheme: 'dart', path: 'async'); |
+ static final Uri DART_HTML = new Uri(scheme: 'dart', path: 'html'); |
static const String INVOKE_ON = '_getCachedInvocation'; |
static const String START_ROOT_ISOLATE = 'startRootIsolate'; |
@@ -273,6 +273,7 @@ class JavaScriptBackend extends Backend { |
FunctionInlineCache inlineCache = new FunctionInlineCache(); |
LibraryElement jsHelperLibrary; |
+ LibraryElement asyncLibrary; |
LibraryElement interceptorsLibrary; |
LibraryElement foreignLibrary; |
LibraryElement isolateHelperLibrary; |
@@ -669,6 +670,7 @@ class JavaScriptBackend extends Backend { |
// TODO(karlklose): Split into findHelperFunction and findHelperClass and |
// add a check that the element has the expected kind. |
Element findHelper(String name) => find(jsHelperLibrary, name); |
+ Element findAsyncAwaitHelper(String name) => find(asyncLibrary, name); |
Lasse Reichstein Nielsen
2015/08/12 09:46:55
Seems like this just looks things up in the async
floitsch
2015/08/12 14:53:44
Done.
|
Element findInterceptor(String name) => find(interceptorsLibrary, name); |
Element find(LibraryElement library, String name) { |
@@ -1850,47 +1852,47 @@ class JavaScriptBackend extends Backend { |
} |
Element getAsyncHelper() { |
- return findHelper("asyncHelper"); |
+ return findAsyncAwaitHelper("_asyncHelper"); |
} |
Element getWrapBody() { |
- return findHelper("_wrapJsFunctionForAsync"); |
+ return findAsyncAwaitHelper("_wrapJsFunctionForAsync"); |
} |
Element getYieldStar() { |
- ClassElement classElement = findHelper("IterationMarker"); |
+ ClassElement classElement = findAsyncAwaitHelper("_IterationMarker"); |
classElement.ensureResolved(compiler); |
return classElement.lookupLocalMember("yieldStar"); |
} |
Element getYieldSingle() { |
- ClassElement classElement = findHelper("IterationMarker"); |
+ ClassElement classElement = findAsyncAwaitHelper("_IterationMarker"); |
classElement.ensureResolved(compiler); |
return classElement.lookupLocalMember("yieldSingle"); |
} |
Element getSyncStarUncaughtError() { |
- ClassElement classElement = findHelper("IterationMarker"); |
+ ClassElement classElement = findAsyncAwaitHelper("_IterationMarker"); |
classElement.ensureResolved(compiler); |
return classElement.lookupLocalMember("uncaughtError"); |
} |
Element getAsyncStarHelper() { |
- return findHelper("asyncStarHelper"); |
+ return findAsyncAwaitHelper("_asyncStarHelper"); |
} |
Element getStreamOfController() { |
- return findHelper("streamOfController"); |
+ return findAsyncAwaitHelper("_streamOfController"); |
} |
Element getEndOfIteration() { |
- ClassElement classElement = findHelper("IterationMarker"); |
+ ClassElement classElement = findAsyncAwaitHelper("_IterationMarker"); |
classElement.ensureResolved(compiler); |
return classElement.lookupLocalMember("endOfIteration"); |
} |
Element getSyncStarIterable() { |
- ClassElement classElement = findHelper("SyncStarIterable"); |
+ ClassElement classElement = findAsyncAwaitHelper("_SyncStarIterable"); |
classElement.ensureResolved(compiler); |
return classElement; |
} |
@@ -1908,7 +1910,8 @@ class JavaScriptBackend extends Backend { |
} |
Element getASyncStarController() { |
- ClassElement classElement = findHelper("AsyncStarStreamController"); |
+ ClassElement classElement = |
+ findAsyncAwaitHelper("_AsyncStarStreamController"); |
classElement.ensureResolved(compiler); |
return classElement; |
} |
@@ -2022,6 +2025,8 @@ class JavaScriptBackend extends Backend { |
Uri uri = library.canonicalUri; |
if (uri == DART_JS_HELPER) { |
jsHelperLibrary = library; |
+ } else if (uri == DART_ASYNC) { |
+ asyncLibrary = library; |
} else if (uri == DART_INTERNAL) { |
internalLibrary = library; |
} else if (uri == DART_INTERCEPTORS) { |