| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 element = library.find(method); | 306 element = library.find(method); |
| 307 } else { | 307 } else { |
| 308 ClassElement classElement = library.find(cls); | 308 ClassElement classElement = library.find(cls); |
| 309 Expect.isNotNull(classElement, | 309 Expect.isNotNull(classElement, |
| 310 "Class '$cls' not found in:\n" | 310 "Class '$cls' not found in:\n" |
| 311 "${library.compilationUnit.script.text}"); | 311 "${library.compilationUnit.script.text}"); |
| 312 element = classElement.localLookup(method); | 312 element = classElement.localLookup(method); |
| 313 } | 313 } |
| 314 var expectedVisits = test.expectedVisits; | 314 var expectedVisits = test.expectedVisits; |
| 315 if (expectedVisits == null) { | 315 if (expectedVisits == null) { |
| 316 Expect.isTrue(element.isErroneous, | 316 Expect.isTrue(element.isMalformed, |
| 317 "Element '$method' expected to be have parse errors in:\n" | 317 "Element '$method' expected to be have parse errors in:\n" |
| 318 "${library.compilationUnit.script.text}"); | 318 "${library.compilationUnit.script.text}"); |
| 319 return; | 319 return; |
| 320 } else if (expectedVisits is! List) { | 320 } else if (expectedVisits is! List) { |
| 321 expectedVisits = [expectedVisits]; | 321 expectedVisits = [expectedVisits]; |
| 322 } | 322 } |
| 323 Expect.isFalse(element.isErroneous, | 323 Expect.isFalse(element.isMalformed, |
| 324 "Element '$method' is not expected to be have parse errors in:\n" | 324 "Element '$method' is not expected to be have parse errors in:\n" |
| 325 "${library.compilationUnit.script.text}"); | 325 "${library.compilationUnit.script.text}"); |
| 326 | 326 |
| 327 void testAstElement(AstElement astElement) { | 327 void testAstElement(AstElement astElement) { |
| 328 Expect.isNotNull(astElement, "Element '$method' not found in:\n" | 328 Expect.isNotNull(astElement, "Element '$method' not found in:\n" |
| 329 "${library.compilationUnit.script.text}"); | 329 "${library.compilationUnit.script.text}"); |
| 330 ResolvedAst resolvedAst = astElement.resolvedAst; | 330 ResolvedAst resolvedAst = astElement.resolvedAst; |
| 331 SemanticTestVisitor visitor = createVisitor(resolvedAst.elements); | 331 SemanticTestVisitor visitor = createVisitor(resolvedAst.elements); |
| 332 try { | 332 try { |
| 333 compiler.reporter.withCurrentElement(resolvedAst.element, () { | 333 compiler.reporter.withCurrentElement(resolvedAst.element, () { |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 ERROR_INVALID_INDEX_SET, | 751 ERROR_INVALID_INDEX_SET, |
| 752 ERROR_INVALID_COMPOUND_INDEX_SET, | 752 ERROR_INVALID_COMPOUND_INDEX_SET, |
| 753 ERROR_INVALID_INDEX_PREFIX, | 753 ERROR_INVALID_INDEX_PREFIX, |
| 754 ERROR_INVALID_INDEX_POSTFIX, | 754 ERROR_INVALID_INDEX_POSTFIX, |
| 755 | 755 |
| 756 VISIT_CONSTANT_GET, | 756 VISIT_CONSTANT_GET, |
| 757 VISIT_CONSTANT_INVOKE, | 757 VISIT_CONSTANT_INVOKE, |
| 758 | 758 |
| 759 PREVISIT_DEFERRED_ACCESS, | 759 PREVISIT_DEFERRED_ACCESS, |
| 760 } | 760 } |
| OLD | NEW |