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

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

Issue 59073003: Version 0.8.10.4 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month 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: dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java
===================================================================
--- dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java (revision 29808)
+++ dart/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java (working copy)
@@ -192,6 +192,19 @@
assertTrue(isFunctionExpression("() => e"));
}
+ public void test_isFunctionExpression_parameter_final() throws Exception {
+ assertTrue(isFunctionExpression("(final a) {}"));
+ assertTrue(isFunctionExpression("(final a, b) {}"));
+ assertTrue(isFunctionExpression("(final a, final b) {}"));
+ }
+
+ public void test_isFunctionExpression_parameter_final_typed() throws Exception {
+ assertTrue(isFunctionExpression("(final int a) {}"));
+ assertTrue(isFunctionExpression("(final prefix.List a) {}"));
+ assertTrue(isFunctionExpression("(final List<int> a) {}"));
+ assertTrue(isFunctionExpression("(final prefix.List<int> a) {}"));
+ }
+
public void test_isFunctionExpression_parameter_multiple() throws Exception {
assertTrue(isFunctionExpression("(a, b) {}"));
}
@@ -930,6 +943,20 @@
assertNotNull(variable.getName());
}
+ public void test_parseClassMember_field_namedOperator_withAssignment() throws Exception {
+ FieldDeclaration field = parse("parseClassMember", new Object[] {"C"}, "var operator = (5);");
+ assertNull(field.getDocumentationComment());
+ assertSize(0, field.getMetadata());
+ assertNull(field.getStaticKeyword());
+ VariableDeclarationList list = field.getFields();
+ assertNotNull(list);
+ NodeList<VariableDeclaration> variables = list.getVariables();
+ assertSize(1, variables);
+ VariableDeclaration variable = variables.get(0);
+ assertNotNull(variable.getName());
+ assertNotNull(variable.getInitializer());
+ }
+
public void test_parseClassMember_field_namedSet() throws Exception {
FieldDeclaration field = parse("parseClassMember", new Object[] {"C"}, "var set;");
assertNull(field.getDocumentationComment());

Powered by Google App Engine
This is Rietveld 408576698