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

Unified Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 839323003: Implementation of async-await transformation on js ast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 5 years, 10 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 | « pkg/compiler/lib/src/js_backend/patch_resolver.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index af2b3028b2aba312190982f0065c4c4da37c1e19..bd92e976ddc5466c14b06c6eea25ce8e9d4bd71f 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -492,15 +492,11 @@ class ResolverTask extends CompilerTask {
}
static void processAsyncMarker(Compiler compiler,
- BaseFunctionElementX element) {
+ BaseFunctionElementX element,
+ Registry registry) {
FunctionExpression functionExpression = element.node;
AsyncModifier asyncModifier = functionExpression.asyncModifier;
if (asyncModifier != null) {
- if (!compiler.enableAsyncAwait) {
- compiler.reportError(asyncModifier,
- MessageKind.EXPERIMENTAL_ASYNC_AWAIT,
- {'modifier': element.asyncMarker});
- }
if (asyncModifier.isAsynchronous) {
element.asyncMarker = asyncModifier.isYielding
@@ -530,6 +526,7 @@ class ResolverTask extends CompilerTask {
{'modifier': element.asyncMarker});
}
}
+ registry.registerAsyncMarker(element);
}
}
@@ -556,6 +553,7 @@ class ResolverTask extends CompilerTask {
ResolutionRegistry registry = visitor.registry;
registry.defineFunction(tree, element);
visitor.setupFunction(tree, element);
+ processAsyncMarker(compiler, element, registry);
if (element.isGenerativeConstructor) {
// Even if there is no initializer list we still have to do the
@@ -630,7 +628,6 @@ class ResolverTask extends CompilerTask {
} else {
element.parseNode(compiler);
element.computeType(compiler);
- processAsyncMarker(compiler, element);
FunctionElementX implementation = element;
if (element.isExternal) {
implementation = compiler.backend.resolveExternalFunction(element);
@@ -2478,7 +2475,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
LocalFunctionElementX function = new LocalFunctionElementX(
name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
enclosingElement);
- ResolverTask.processAsyncMarker(compiler, function);
+ ResolverTask.processAsyncMarker(compiler, function, registry);
function.functionSignatureCache = SignatureResolver.analyze(
compiler,
node.parameters,
« no previous file with comments | « pkg/compiler/lib/src/js_backend/patch_resolver.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698