OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.semantics_visitor_test; | 5 library dart2js.semantics_visitor_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 compiler.withCurrentElement(resolvedAst.element, () { | 332 compiler.withCurrentElement(resolvedAst.element, () { |
333 //print(resolvedAst.node.toDebugString()); | 333 //print(resolvedAst.node.toDebugString()); |
334 resolvedAst.node.accept(visitor); | 334 resolvedAst.node.accept(visitor); |
335 }); | 335 }); |
336 } catch (e, s) { | 336 } catch (e, s) { |
337 Expect.fail("$e:\n$s\nIn test:\n" | 337 Expect.fail("$e:\n$s\nIn test:\n" |
338 "${library.compilationUnit.script.text}"); | 338 "${library.compilationUnit.script.text}"); |
339 } | 339 } |
340 Expect.listEquals(expectedVisits, visitor.visits, | 340 Expect.listEquals(expectedVisits, visitor.visits, |
341 "In test:\n" | 341 "In test:\n" |
342 "${library.compilationUnit.script.text}"); | 342 "${library.compilationUnit.script.text}\n\n" |
| 343 "Expected: $expectedVisits\n" |
| 344 "Found: ${visitor.visits}"); |
343 unvisitedKinds.removeAll(visitor.visits.map((visit) => visit.method)); | 345 unvisitedKinds.removeAll(visitor.visits.map((visit) => visit.method)); |
344 } | 346 } |
345 if (element.isAbstractField) { | 347 if (element.isAbstractField) { |
346 AbstractFieldElement abstractFieldElement = element; | 348 AbstractFieldElement abstractFieldElement = element; |
347 if (abstractFieldElement.getter != null) { | 349 if (abstractFieldElement.getter != null) { |
348 testAstElement(abstractFieldElement.getter); | 350 testAstElement(abstractFieldElement.getter); |
349 } else if (abstractFieldElement.setter != null) { | 351 } else if (abstractFieldElement.setter != null) { |
350 testAstElement(abstractFieldElement.setter); | 352 testAstElement(abstractFieldElement.setter); |
351 } | 353 } |
352 } else { | 354 } else { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX, | 697 VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX, |
696 VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX, | 698 VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX, |
697 | 699 |
698 ERROR_INVALID_ASSERT, | 700 ERROR_INVALID_ASSERT, |
699 ERROR_UNDEFINED_UNARY_EXPRESSION, | 701 ERROR_UNDEFINED_UNARY_EXPRESSION, |
700 ERROR_UNDEFINED_BINARY_EXPRESSION, | 702 ERROR_UNDEFINED_BINARY_EXPRESSION, |
701 | 703 |
702 VISIT_CONSTANT_GET, | 704 VISIT_CONSTANT_GET, |
703 VISIT_CONSTANT_INVOKE, | 705 VISIT_CONSTANT_INVOKE, |
704 } | 706 } |
OLD | NEW |