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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.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/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java b/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
index 2d4d80a536a7ff813d670e82ec7b209fbd0475a4..200f1c0dad7fbbe6ccbbc70a76bda93236d38467 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartToSourceVisitor.java
@@ -280,7 +280,7 @@ public class DartToSourceVisitor extends ASTVisitor<Void> {
p("set ");
}
// name
- pFunctionDeclaration(x.getName(), func);
+ pFunctionDeclaration(x.getName(), func, !x.getModifiers().isGetter());
p(" ");
// initializers
List<DartInitializer> inits = x.getInitializers();
@@ -338,13 +338,15 @@ public class DartToSourceVisitor extends ASTVisitor<Void> {
}
}
- private void pFunctionDeclaration(DartNode name, DartFunction x) {
+ private void pFunctionDeclaration(DartNode name, DartFunction x, boolean includeParameters) {
if (name != null) {
accept(name);
}
- p("(");
- pFormalParameters(x.getParameters());
- p(")");
+ if (includeParameters) {
+ p("(");
+ pFormalParameters(x.getParameters());
+ p(")");
+ }
}
private void pFormalParameters(List<DartParameter> params) {
@@ -793,7 +795,7 @@ public class DartToSourceVisitor extends ASTVisitor<Void> {
p(" ");
}
DartIdentifier name = x.getName();
- pFunctionDeclaration(name, x.getFunction());
+ pFunctionDeclaration(name, x.getFunction(), true);
p(" ");
if (x.getFunction().getBody() != null) {
pBlock(x.getFunction().getBody(), false);

Powered by Google App Engine
This is Rietveld 408576698