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

Unified Diff: pkg/compiler/lib/src/diagnostics/dart2js_messages.dart

Issue 1504403005: Add missing compile-time errors for async/await. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix after rebase Created 5 years 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 | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/diagnostics/dart2js_messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/dart2js_messages.dart b/pkg/compiler/lib/src/diagnostics/dart2js_messages.dart
index 2dfa32434189d608b63bd6d94e5dbcbe56e000c9..0f4e6247c53531ed8f8431ea22ce6300da54742b 100644
--- a/pkg/compiler/lib/src/diagnostics/dart2js_messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/dart2js_messages.dart
@@ -3185,7 +3185,6 @@ below as well as the source location above).
'INVALID_SYNC_MODIFIER': {
'id': 'FNYUYU',
'template': "Invalid modifier 'sync'.",
- 'options': ['--enable-async'],
'howToFix': "Try replacing 'sync' with 'sync*'.",
'examples': ["main() sync {}"],
},
@@ -3193,7 +3192,6 @@ below as well as the source location above).
'INVALID_AWAIT_FOR': {
'id': 'IEYGCY',
'template': "'await' is only supported on for-in loops.",
- 'options': ['--enable-async'],
'howToFix': "Try rewriting the loop as a for-in loop or removing the "
"'await' keyword.",
'examples': [
@@ -3205,6 +3203,49 @@ await for (int i = 0; i < 10; i++) {}
],
},
+ 'INVALID_AWAIT_FOR_IN': {
+ 'id': 'FIEYGC',
+ 'template': "'await' is only supported in methods with an 'async' or "
+ "'async*' body modifier.",
+ 'howToFix': "Try adding 'async' or 'async*' to the method body or "
+ "removing the 'await' keyword.",
+ 'examples': [
+ """
+main(o) sync* {
+ await for (var e in o) {}
+}
+"""
+ ],
+ },
+
+ 'INVALID_AWAIT': {
+ 'id': 'IEYHYD',
+ 'template': "'await' is only supported in methods with an 'async' or "
+ "'async*' body modifier.",
+ 'howToFix': "Try adding 'async' or 'async*' to the method body.",
+ 'examples': [
+ """
+main() sync* {
+ await null;
+}
+"""
+ ],
+ },
+
+ 'INVALID_YIELD': {
+ 'id': 'IPGGCY',
+ 'template': "'yield' is only supported in methods with a 'sync*' or "
+ "'async*' body modifier.",
+ 'howToFix': "Try adding 'sync*' or 'async*' to the method body.",
+ 'examples': [
+ """
+main() async {
+ yield 0;
+}
+"""
+ ],
+ },
+
'ASYNC_MODIFIER_ON_ABSTRACT_METHOD': {
'id': 'VRISLY',
'template':
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698