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

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

Issue 10928236: Fix the length of this expression nodes (issue 5185) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
===================================================================
--- compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (revision 12443)
+++ compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java (working copy)
@@ -22,6 +22,7 @@
import com.google.dart.compiler.ast.DartMapLiteral;
import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNode;
+import com.google.dart.compiler.ast.DartParameter;
import com.google.dart.compiler.ast.DartPropertyAccess;
import com.google.dart.compiler.ast.DartStatement;
import com.google.dart.compiler.ast.DartStringInterpolation;
@@ -1428,6 +1429,21 @@
ParserErrorCode.FOR_IN_WITH_MULTIPLE_VARIABLES, 2, 17);
}
+ public void test_formalParameters_field() throws Exception {
+ DartUnit unit = parseUnit("formalParameters.dart",
+ Joiner.on("\n").join(
+ "class A {",
+ " final foo;",
+ " A(this.foo) {}",
+ "}"));
+ DartClass classNode = (DartClass) unit.getTopLevelNodes().get(0);
+ DartMethodDefinition methodNode = (DartMethodDefinition) classNode.getMembers().get(1);
+ DartParameter parameterNode = methodNode.getFunction().getParameters().get(0);
+ assertTrue(parameterNode.getName() instanceof DartPropertyAccess);
+ DartPropertyAccess accessNode = (DartPropertyAccess) parameterNode.getName();
+ assertEquals(4, accessNode.getQualifier().getSourceInfo().getLength());
+ }
+
public void test_formalParameters_named() throws Exception {
parseUnit("formalParameters.dart",
Joiner.on("\n").join(
« no previous file with comments | « compiler/java/com/google/dart/compiler/parser/DartParser.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698