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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java

Issue 501373002: Fix for issue 20690 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | « editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ParserTestCase.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java
index 2fe25613396fa404c755f03c920b62c9fea23471..ddd0b84438adcdc9628a49bbd413d1cbee1b0cd6 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java
@@ -582,6 +582,32 @@ public class SimpleParserTest extends ParserTestCase {
assertNotNull(expression.getExpression());
}
+ public void test_parseAwaitExpression_asStatement_inAsync() throws Exception {
+ MethodDeclaration method = parse(
+ "parseClassMember",
+ new Object[] {"C"},
+ createSource("m() async { await x; }"));
+ FunctionBody body = method.getBody();
+ assertInstanceOf(BlockFunctionBody.class, body);
+ Statement statement = ((BlockFunctionBody) body).getBlock().getStatements().get(0);
+ assertInstanceOf(ExpressionStatement.class, statement);
+ Expression expression = ((ExpressionStatement) statement).getExpression();
+ assertInstanceOf(AwaitExpression.class, expression);
+ assertNotNull(((AwaitExpression) expression).getAwaitKeyword());
+ assertNotNull(((AwaitExpression) expression).getExpression());
+ }
+
+ public void test_parseAwaitExpression_asStatement_inSync() throws Exception {
+ MethodDeclaration method = parse(
+ "parseClassMember",
+ new Object[] {"C"},
+ createSource("m() { await x; }"));
+ FunctionBody body = method.getBody();
+ assertInstanceOf(BlockFunctionBody.class, body);
+ Statement statement = ((BlockFunctionBody) body).getBlock().getStatements().get(0);
+ assertInstanceOf(VariableDeclarationStatement.class, statement);
+ }
+
public void test_parseBitwiseAndExpression_normal() throws Exception {
BinaryExpression expression = parse("parseBitwiseAndExpression", "x & y");
assertNotNull(expression.getLeftOperand());
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ParserTestCase.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698