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

Side by Side Diff: compiler/javatests/com/google/dart/compiler/parser/NegativeParserTest.java

Issue 10700146: Issue 4040. Fix NPE when report problem with no node. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 package com.google.dart.compiler.parser; 4 package com.google.dart.compiler.parser;
5 5
6 import com.google.common.base.Joiner; 6 import com.google.common.base.Joiner;
7 import com.google.dart.compiler.CompilerTestCase; 7 import com.google.dart.compiler.CompilerTestCase;
8 import com.google.dart.compiler.ast.DartClass; 8 import com.google.dart.compiler.ast.DartClass;
9 import com.google.dart.compiler.ast.DartIdentifier; 9 import com.google.dart.compiler.ast.DartIdentifier;
10 import com.google.dart.compiler.ast.DartMethodDefinition; 10 import com.google.dart.compiler.ast.DartMethodDefinition;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_ITSELF, 1, 39, 7)); 72 errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_ITSELF, 1, 39, 7));
73 } 73 }
74 74
75 public void testMultipleRedirectionConstructors() { 75 public void testMultipleRedirectionConstructors() {
76 parseExpectErrors( 76 parseExpectErrors(
77 "class A { A(x) { } A.foo() : this(1), this(2); }", 77 "class A { A(x) { } A.foo() : this(1), this(2); }",
78 errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_MULTIPLE, 1, 30, 7), 78 errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_MULTIPLE, 1, 30, 7),
79 errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_MULTIPLE, 1, 39, 7)); 79 errEx(ParserErrorCode.REDIRECTING_CONSTRUCTOR_MULTIPLE, 1, 39, 7));
80 } 80 }
81 81
82 /**
83 * May be parsing errors, but not exceptions.
84 * <p>
85 * http://code.google.com/p/dart/issues/detail?id=4040
86 */
87 public void test_incompleteArguments() {
88 parseSource(makeCode(
89 "// filler filler filler filler filler filler filler filler filler fille r",
90 "main() {",
91 " f(a: 0,",
92 "}",
93 ""));
94 }
95
82 public void testSuperMultipleInvocationsTest() { 96 public void testSuperMultipleInvocationsTest() {
83 String source = 97 String source =
84 makeCode( 98 makeCode(
85 "class A {", 99 "class A {",
86 " int a;", 100 " int a;",
87 " A(this.a);", 101 " A(this.a);",
88 " A.foo(int x, int y);", 102 " A.foo(int x, int y);",
89 "}", 103 "}",
90 "", 104 "",
91 "class B extends A {", 105 "class B extends A {",
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 public void test_qualifiedType_inForIn() { 1032 public void test_qualifiedType_inForIn() {
1019 parseExpectErrors(Joiner.on("\n").join( 1033 parseExpectErrors(Joiner.on("\n").join(
1020 "// filler filler filler filler filler filler filler filler filler fille r", 1034 "// filler filler filler filler filler filler filler filler filler fille r",
1021 "foo() {", 1035 "foo() {",
1022 " for (pref.A a in elements) {", 1036 " for (pref.A a in elements) {",
1023 " }", 1037 " }",
1024 "}", 1038 "}",
1025 "")); 1039 ""));
1026 } 1040 }
1027 } 1041 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698