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

Unified Diff: tests/compiler/dart2js/parser_test.dart

Issue 10836034: Properly parse operator declarations without return type. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Next iteration Created 8 years, 4 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 | « lib/compiler/implementation/tree/unparser.dart ('k') | tests/language/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/parser_test.dart
diff --git a/tests/compiler/dart2js/parser_test.dart b/tests/compiler/dart2js/parser_test.dart
index d68d23f039ea39f47f99b4a96e7c11b2dd7a1da0..393d8207feb548134f022f6967ddee65af419c53 100644
--- a/tests/compiler/dart2js/parser_test.dart
+++ b/tests/compiler/dart2js/parser_test.dart
@@ -254,6 +254,18 @@ void testPostfix() {
Expect.isTrue(sendSet.arguments.isEmpty());
}
+void testOperatorParse() {
+ FunctionDeclaration node = parseStatement('operator negate() => null;');
+ FunctionExpression expr = node.function;
ahe 2012/08/06 10:35:38 Look at the rest of this file. We don't abbreviate
Anton Muhin 2012/08/06 11:36:18 Done.
+ Node name = expr.name;
+ Expect.isTrue(name is Send);
ahe 2012/08/06 10:35:38 See the above code in testPostfix. This should be:
Anton Muhin 2012/08/06 11:36:18 Done.
+ Expect.equals(name.receiver.source.stringValue, 'operator');
ahe 2012/08/06 10:35:38 Use stringEquals and put the expected value first.
Anton Muhin 2012/08/06 11:36:18 Done.
+ Expect.equals(name.selector.source.stringValue, 'negate');
ahe 2012/08/06 10:35:38 Ditto.
Anton Muhin 2012/08/06 11:36:19 Done.
+ Expect.isTrue(expr.parameters.isEmpty());
+ Expect.isNull(expr.returnType);
+ Expect.isNull(expr.getOrSet);
+}
+
void main() {
testGenericTypes();
// TODO(ahe): Enable this test when we handle library prefixes.
@@ -267,4 +279,5 @@ void main() {
testAssignment();
testIndex();
testPostfix();
+ testOperatorParse();
}
« no previous file with comments | « lib/compiler/implementation/tree/unparser.dart ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698