| Index: dart/tests/compiler/dart2js/parser_test.dart
|
| diff --git a/dart/tests/compiler/dart2js/parser_test.dart b/dart/tests/compiler/dart2js/parser_test.dart
|
| index 3847f48b22cd9cf759c74d19c87c82f39a37ed0d..db4a8cd387d4e6cf64043b49a6f19ed613b71b07 100644
|
| --- a/dart/tests/compiler/dart2js/parser_test.dart
|
| +++ b/dart/tests/compiler/dart2js/parser_test.dart
|
| @@ -265,6 +265,32 @@ void testOperatorParse() {
|
| Expect.isNull(function.getOrSet);
|
| }
|
|
|
| +class Collector implements DiagnosticListener {
|
| + final List<int> tokens = <int>[];
|
| +
|
| + void cancel(String reason, {node, token, instruction, element}) {
|
| + tokens.add(token.kind);
|
| + throw this;
|
| + }
|
| +
|
| + void log(message) {
|
| + print(message);
|
| + }
|
| +}
|
| +
|
| +void testMissingCloseParen() {
|
| + final String source =
|
| +'''foo(x { // <= missing closing ")"
|
| + return x;
|
| +}''';
|
| + Expect.throws(() => parseMember(source, lc: new Collector()),
|
| + (Collector c) {
|
| + Expect.listEquals(const <int>[OPEN_CURLY_BRACKET_TOKEN],
|
| + c.tokens);
|
| + return true;
|
| + });
|
| +}
|
| +
|
| void main() {
|
| testGenericTypes();
|
| // TODO(ahe): Enable this test when we handle library prefixes.
|
| @@ -279,4 +305,5 @@ void main() {
|
| testIndex();
|
| testPostfix();
|
| testOperatorParse();
|
| + testMissingCloseParen();
|
| }
|
|
|