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

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: 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..28e53e87e484e06e24bc3c297828f5b5b54536d1 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 function = node.function;
+ Send name = function.name.asSend();
+ Expect.isNotNull(name);
+ Expect.stringEquals('operator', name.receiver.source.stringValue);
+ Expect.stringEquals('negate', name.selector.source.stringValue);
+ Expect.isTrue(function.parameters.isEmpty());
+ Expect.isNull(function.returnType);
+ Expect.isNull(function.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