| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Test of Compiler.forgetElement. | 5 // Test of Compiler.forgetElement. |
| 6 library trydart.forget_element_test; | 6 library trydart.forget_element_test; |
| 7 | 7 |
| 8 import 'package:compiler/implementation/elements/elements.dart' show | 8 import 'package:compiler/src/elements/elements.dart' show |
| 9 AstElement, | 9 AstElement, |
| 10 ClassElement, | 10 ClassElement, |
| 11 Element, | 11 Element, |
| 12 FunctionElement, | 12 FunctionElement, |
| 13 LocalFunctionElement, | 13 LocalFunctionElement, |
| 14 MetadataAnnotation, | 14 MetadataAnnotation, |
| 15 ScopeContainerElement, | 15 ScopeContainerElement, |
| 16 VariableElement; | 16 VariableElement; |
| 17 | 17 |
| 18 import 'package:compiler/implementation/js_backend/js_backend.dart' show | 18 import 'package:compiler/src/js_backend/js_backend.dart' show |
| 19 JavaScriptBackend; | 19 JavaScriptBackend; |
| 20 | 20 |
| 21 import 'package:compiler/implementation/tree/tree.dart' as tree; | 21 import 'package:compiler/src/tree/tree.dart' as tree; |
| 22 | 22 |
| 23 import 'package:compiler/implementation/scanner/scannerlib.dart' show | 23 import 'package:compiler/src/scanner/scannerlib.dart' show |
| 24 PartialMetadataAnnotation; | 24 PartialMetadataAnnotation; |
| 25 | 25 |
| 26 import 'package:compiler/implementation/elements/visitor.dart' show | 26 import 'package:compiler/src/elements/visitor.dart' show |
| 27 ElementVisitor; | 27 ElementVisitor; |
| 28 | 28 |
| 29 import 'package:compiler/implementation/dart2jslib.dart' show | 29 import 'package:compiler/src/dart2jslib.dart' show |
| 30 DartConstantCompiler; | 30 DartConstantCompiler; |
| 31 | 31 |
| 32 import 'package:compiler/implementation/universe/universe.dart' show | 32 import 'package:compiler/src/universe/universe.dart' show |
| 33 Universe; | 33 Universe; |
| 34 | 34 |
| 35 import 'package:compiler/implementation/dart_types.dart' show | 35 import 'package:compiler/src/dart_types.dart' show |
| 36 DartType; | 36 DartType; |
| 37 | 37 |
| 38 import 'compiler_test_case.dart'; | 38 import 'compiler_test_case.dart'; |
| 39 | 39 |
| 40 import 'forget_element_assertion.dart' show | 40 import 'forget_element_assertion.dart' show |
| 41 assertUnimplementedLocalMetadata; | 41 assertUnimplementedLocalMetadata; |
| 42 | 42 |
| 43 class ForgetElementTestCase extends CompilerTestCase { | 43 class ForgetElementTestCase extends CompilerTestCase { |
| 44 final int expectedClosureCount; | 44 final int expectedClosureCount; |
| 45 | 45 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 // Test that a constant in a parameter initializer is discarded | 394 // Test that a constant in a parameter initializer is discarded |
| 395 // correctly (deeply nested function). | 395 // correctly (deeply nested function). |
| 396 new ForgetElementTestCase( | 396 new ForgetElementTestCase( |
| 397 'main() => (() => (([x = const Constant()]) => x)())();' | 397 'main() => (() => (([x = const Constant()]) => x)())();' |
| 398 ' $CONSTANT_CLASS', | 398 ' $CONSTANT_CLASS', |
| 399 closureCount: 2, | 399 closureCount: 2, |
| 400 constantCount: 1, | 400 constantCount: 1, |
| 401 initialValueCount: 1), | 401 initialValueCount: 1), |
| 402 | 402 |
| 403 ]..addAll(assertUnimplementedLocalMetadata()); | 403 ]..addAll(assertUnimplementedLocalMetadata()); |
| OLD | NEW |