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

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

Issue 15269005: Report ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY and other body-related errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for review comments. Created 7 years, 7 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
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 180abe0028c309e13bf91b81e4c6f13ccfce0842..494a0c3c062540f76cb72fd994635977d565cf56 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
@@ -2636,20 +2636,24 @@ public class SimpleParserTest extends ParserTestCase {
}
public void test_parseFunctionBody_block() throws Exception {
- BlockFunctionBody functionBody = parse("parseFunctionBody", new Object[] {false, false}, "{}");
+ BlockFunctionBody functionBody = parse(
+ "parseFunctionBody",
+ new Object[] {false, null, false},
+ "{}");
assertNotNull(functionBody.getBlock());
}
public void test_parseFunctionBody_empty() throws Exception {
- EmptyFunctionBody functionBody = parse("parseFunctionBody", new Object[] {true, false}, ";");
+ EmptyFunctionBody functionBody = parse(
+ "parseFunctionBody",
+ new Object[] {true, null, false},
+ ";");
assertNotNull(functionBody.getSemicolon());
}
public void test_parseFunctionBody_expression() throws Exception {
- ExpressionFunctionBody functionBody = parse(
- "parseFunctionBody",
- new Object[] {false, false},
- "=> y;");
+ ExpressionFunctionBody functionBody = parse("parseFunctionBody", new Object[] {
+ false, null, false}, "=> y;");
assertNotNull(functionBody.getFunctionDefinition());
assertNotNull(functionBody.getExpression());
assertNotNull(functionBody.getSemicolon());
@@ -2658,7 +2662,7 @@ public class SimpleParserTest extends ParserTestCase {
public void test_parseFunctionBody_nativeFunctionBody() throws Exception {
NativeFunctionBody functionBody = parse(
"parseFunctionBody",
- new Object[] {false, false},
+ new Object[] {false, null, false},
"native 'str';");
assertNotNull(functionBody.getNativeToken());
assertNotNull(functionBody.getStringLiteral());
@@ -2751,7 +2755,7 @@ public class SimpleParserTest extends ParserTestCase {
Token staticKeyword = token(Keyword.STATIC);
TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
MethodDeclaration method = parse("parseGetter", new Object[] {
- commentAndMetadata(comment), null, staticKeyword, returnType}, "get a;");
+ commentAndMetadata(comment), null, staticKeyword, returnType}, "get a => 42;");
assertNotNull(method.getBody());
assertEquals(comment, method.getDocumentationComment());
assertNull(method.getExternalKeyword());

Powered by Google App Engine
This is Rietveld 408576698