| 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/src/elements/elements.dart' show | 8 import 'package:compiler/src/elements/elements.dart' show |
| 9 AstElement, | 9 AstElement, |
| 10 ClassElement, | 10 ClassElement, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 Iterable resolutionMembersIn(LibraryElement library) { | 254 Iterable resolutionMembersIn(LibraryElement library) { |
| 255 sameLibrary(e) => e.library == library; | 255 sameLibrary(e) => e.library == library; |
| 256 return new Set() | 256 return new Set() |
| 257 ..addAll(resolutionUniverse.closurizedMembers.where(sameLibrary)) | 257 ..addAll(resolutionUniverse.closurizedMembers.where(sameLibrary)) |
| 258 ..addAll(resolutionUniverse.fieldSetters.where(sameLibrary)) | 258 ..addAll(resolutionUniverse.fieldSetters.where(sameLibrary)) |
| 259 ..addAll(resolutionUniverse.fieldGetters.where(sameLibrary)); | 259 ..addAll(resolutionUniverse.fieldGetters.where(sameLibrary)); |
| 260 } | 260 } |
| 261 | 261 |
| 262 Iterable codegenSeenClassesIn(LibraryElement library) { | 262 Iterable codegenSeenClassesIn(LibraryElement library) { |
| 263 return compiler.codegenWorld.allInstantiatedClasses.where( | 263 return compiler.enqueuer.codegen.processedClasses.where( |
| 264 (e) => e.library == library); | 264 (e) => e.library == library); |
| 265 } | 265 } |
| 266 | 266 |
| 267 Iterable resolutionSeenClassesIn(LibraryElement library) { | 267 Iterable resolutionSeenClassesIn(LibraryElement library) { |
| 268 return compiler.resolverWorld.allInstantiatedClasses.where( | 268 return compiler.enqueuer.resolution.processedClasses.where( |
| 269 (e) => e.library == library); | 269 (e) => e.library == library); |
| 270 } | 270 } |
| 271 } | 271 } |
| 272 | 272 |
| 273 class NodeCollector extends tree.Visitor { | 273 class NodeCollector extends tree.Visitor { |
| 274 final List<tree.Node> nodes = <tree.Node>[]; | 274 final List<tree.Node> nodes = <tree.Node>[]; |
| 275 | 275 |
| 276 void visitNode(tree.Node node) { | 276 void visitNode(tree.Node node) { |
| 277 nodes.add(node); | 277 nodes.add(node); |
| 278 node.visitChildren(this); | 278 node.visitChildren(this); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // TODO(ahe): Add test for super sends [backend.aliasedSuperMembers]. | 403 // TODO(ahe): Add test for super sends [backend.aliasedSuperMembers]. |
| 404 ]..addAll(assertUnimplementedLocalMetadata()); | 404 ]..addAll(assertUnimplementedLocalMetadata()); |
| OLD | NEW |