| OLD | NEW |
| 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 | 4 |
| 5 package com.google.dart.compiler.parser; | 5 package com.google.dart.compiler.parser; |
| 6 | 6 |
| 7 import com.google.common.base.Joiner; | 7 import com.google.common.base.Joiner; |
| 8 import com.google.dart.compiler.ast.DartClass; | 8 import com.google.dart.compiler.ast.DartClass; |
| 9 import com.google.dart.compiler.ast.DartFieldDefinition; | 9 import com.google.dart.compiler.ast.DartFieldDefinition; |
| 10 import com.google.dart.compiler.ast.DartIdentifier; | 10 import com.google.dart.compiler.ast.DartIdentifier; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 assertEquals("/", ((DartIdentifier)opDiv.getName()).getName()); | 272 assertEquals("/", ((DartIdentifier)opDiv.getName()).getName()); |
| 273 DartMethodDefinition opAssignDiv = (DartMethodDefinition)foo.getMembers().ge
t(1); | 273 DartMethodDefinition opAssignDiv = (DartMethodDefinition)foo.getMembers().ge
t(1); |
| 274 assertEquals("/=", ((DartIdentifier)opAssignDiv.getName()).getName()); | 274 assertEquals("/=", ((DartIdentifier)opAssignDiv.getName()).getName()); |
| 275 DartMethodDefinition opNonsense = (DartMethodDefinition)foo.getMembers().get
(2); | 275 DartMethodDefinition opNonsense = (DartMethodDefinition)foo.getMembers().get
(2); |
| 276 assertEquals("][", ((DartIdentifier)opNonsense.getName()).getName()); | 276 assertEquals("][", ((DartIdentifier)opNonsense.getName()).getName()); |
| 277 DartMethodDefinition opEquiv = (DartMethodDefinition)foo.getMembers().get(3)
; | 277 DartMethodDefinition opEquiv = (DartMethodDefinition)foo.getMembers().get(3)
; |
| 278 assertEquals("===", ((DartIdentifier)opEquiv.getName()).getName()); | 278 assertEquals("===", ((DartIdentifier)opEquiv.getName()).getName()); |
| 279 DartMethodDefinition opPlus = (DartMethodDefinition)foo.getMembers().get(4); | 279 DartMethodDefinition opPlus = (DartMethodDefinition)foo.getMembers().get(4); |
| 280 assertEquals("+", ((DartIdentifier)opPlus.getName()).getName()); | 280 assertEquals("+", ((DartIdentifier)opPlus.getName()).getName()); |
| 281 } | 281 } |
| 282 |
| 283 public void testPropertyAccessInArgumentListRecovery() { |
| 284 DartUnit unit = parseUnitUnspecifiedErrors("phony_recover_to_toplevel8.dart"
, |
| 285 Joiner.on("\n").join( |
| 286 "var before;", |
| 287 "var bad = new B(null, foo.);", |
| 288 "var after;")); |
| 289 DartFieldDefinition before = (DartFieldDefinition)unit.getTopLevelNodes().ge
t(0); |
| 290 assertEquals("before", before.getFields().get(0).getName().getName()); |
| 291 DartFieldDefinition bad = (DartFieldDefinition)unit.getTopLevelNodes().get(1
); |
| 292 assertEquals("bad", bad.getFields().get(0).getName().getName()); |
| 293 DartFieldDefinition after = (DartFieldDefinition)unit.getTopLevelNodes().get
(2); |
| 294 assertEquals("after", after.getFields().get(0).getName().getName()); |
| 295 } |
| 282 } | 296 } |
| OLD | NEW |