| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 493 |
| 494 static void processAsyncMarker(Compiler compiler, | 494 static void processAsyncMarker(Compiler compiler, |
| 495 BaseFunctionElementX element) { | 495 BaseFunctionElementX element) { |
| 496 FunctionExpression functionExpression = element.node; | 496 FunctionExpression functionExpression = element.node; |
| 497 AsyncModifier asyncModifier = functionExpression.asyncModifier; | 497 AsyncModifier asyncModifier = functionExpression.asyncModifier; |
| 498 if (asyncModifier != null) { | 498 if (asyncModifier != null) { |
| 499 if (!compiler.enableAsyncAwait) { | 499 if (!compiler.enableAsyncAwait) { |
| 500 compiler.reportError(asyncModifier, | 500 compiler.reportError(asyncModifier, |
| 501 MessageKind.EXPERIMENTAL_ASYNC_AWAIT, | 501 MessageKind.EXPERIMENTAL_ASYNC_AWAIT, |
| 502 {'modifier': element.asyncMarker}); | 502 {'modifier': element.asyncMarker}); |
| 503 } else if (!compiler.analyzeOnly) { | |
| 504 compiler.reportError(asyncModifier, | |
| 505 MessageKind.EXPERIMENTAL_ASYNC_AWAIT, | |
| 506 {'modifier': element.asyncMarker}); | |
| 507 } | 503 } |
| 508 | 504 |
| 509 if (asyncModifier.isAsynchronous) { | 505 if (asyncModifier.isAsynchronous) { |
| 510 element.asyncMarker = asyncModifier.isYielding | 506 element.asyncMarker = asyncModifier.isYielding |
| 511 ? AsyncMarker.ASYNC_STAR : AsyncMarker.ASYNC; | 507 ? AsyncMarker.ASYNC_STAR : AsyncMarker.ASYNC; |
| 512 } else { | 508 } else { |
| 513 element.asyncMarker = AsyncMarker.SYNC_STAR; | 509 element.asyncMarker = AsyncMarker.SYNC_STAR; |
| 514 } | 510 } |
| 515 if (element.isAbstract) { | 511 if (element.isAbstract) { |
| 516 compiler.reportError(asyncModifier, | 512 compiler.reportError(asyncModifier, |
| (...skipping 4513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5030 } | 5026 } |
| 5031 | 5027 |
| 5032 /// The result for the resolution of the `assert` method. | 5028 /// The result for the resolution of the `assert` method. |
| 5033 class AssertResult implements ResolutionResult { | 5029 class AssertResult implements ResolutionResult { |
| 5034 const AssertResult(); | 5030 const AssertResult(); |
| 5035 | 5031 |
| 5036 Element get element => null; | 5032 Element get element => null; |
| 5037 | 5033 |
| 5038 String toString() => 'AssertResult()'; | 5034 String toString() => 'AssertResult()'; |
| 5039 } | 5035 } |
| OLD | NEW |