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

Unified Diff: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java

Issue 11305007: Getter with parameters is error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
index f6273143681e30b7317385b46d8fa54503b49bd7..b1b18c4c5e35f11b2347e1d1c95d139d6662bcce 100644
--- a/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
+++ b/compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java
@@ -21,13 +21,17 @@ import java.util.Set;
* Negative Parser/Syntax tests.
*/
public class NegativeParserTest extends CompilerTestCase {
+ public void test_deprecatedGetterSyntax() {
+ parseExpectErrors("get foo() {}", errEx(ParserErrorCode.DEPRECATED_GETTER, 1, 5, 3));
+ }
+
public void testFieldInitializerInRedirectionConstructor1() {
parseExpectErrors(
"class A { A(x) { } A.foo() : this(5), y = 5; var y; }",
errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_OTHER, 1, 39, 5),
errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_ITSELF, 1, 30, 7));
}
-
+
public void testFieldInitializerInRedirectionConstructor2() {
parseExpectErrors(
"class A { A(x) { } A.foo() : y = 5, this(5); var y; }",
@@ -578,7 +582,7 @@ public class NegativeParserTest extends CompilerTestCase {
"class MyClass {}",
"class MyInterface {}",
"topLevelMethod() {}",
- "int get topLevelGetter() {return 0;}",
+ "int get topLevelGetter {return 0;}",
"void set topLevelSetter(int v) {}",
"typedef void MyTypeDef();",
""));
@@ -630,7 +634,7 @@ public class NegativeParserTest extends CompilerTestCase {
" }",
"}",
"topLevelMethod() {}",
- "int get topLevelGetter() {return 0;}",
+ "int get topLevelGetter {return 0;}",
"void set topLevelSetter(int setterParam) {}",
"typedef void MyTypeDef();",
""));

Powered by Google App Engine
This is Rietveld 408576698