OLD | NEW |
---|---|
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // Partial test that the closed world computed from [WorldImpact]s derived from | 5 // Partial test that the closed world computed from [WorldImpact]s derived from |
6 // kernel is equivalent to the original computed from resolution. | 6 // kernel is equivalent to the original computed from resolution. |
7 library dart2js.kernel.closed_world2_test; | 7 library dart2js.kernel.closed_world2_test; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 | 10 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 | 284 |
285 check(cls1, cls2, 'superclass', env1.getSuperClass(cls1), | 285 check(cls1, cls2, 'superclass', env1.getSuperClass(cls1), |
286 env2.getSuperClass(cls2), equivalence.entityEquivalence); | 286 env2.getSuperClass(cls2), equivalence.entityEquivalence); |
287 | 287 |
288 Map<MemberEntity, ClassEntity> members1 = <MemberEntity, ClassEntity>{}; | 288 Map<MemberEntity, ClassEntity> members1 = <MemberEntity, ClassEntity>{}; |
289 Map<MemberEntity, ClassEntity> members2 = <MemberEntity, ClassEntity>{}; | 289 Map<MemberEntity, ClassEntity> members2 = <MemberEntity, ClassEntity>{}; |
290 env1.forEachClassMember(cls1, | 290 env1.forEachClassMember(cls1, |
291 (ClassEntity declarer1, MemberEntity member1) { | 291 (ClassEntity declarer1, MemberEntity member1) { |
292 members1[member1] = declarer1; | 292 members1[member1] = declarer1; |
293 }); | 293 }); |
294 env1.forEachClassMember(cls1, | 294 env2.forEachClassMember(cls2, |
Siggi Cherem (dart-lang)
2017/05/09 18:10:56
eek!
| |
295 (ClassEntity declarer2, MemberEntity member2) { | 295 (ClassEntity declarer2, MemberEntity member2) { |
296 members2[member2] = declarer2; | 296 members2[member2] = declarer2; |
297 }); | 297 }); |
298 checkMapEquivalence(cls1, cls2, 'members', members1, members2, | 298 checkMapEquivalence(cls1, cls2, 'members', members1, members2, |
299 equivalence.entityEquivalence, equivalence.entityEquivalence); | 299 equivalence.entityEquivalence, equivalence.entityEquivalence); |
300 | 300 |
301 classes2.add(cls2); | 301 classes2.add(cls2); |
302 }); | 302 }); |
303 env2.forEachClass(lib2, (ClassEntity cls2) { | 303 env2.forEachClass(lib2, (ClassEntity cls2) { |
304 Expect.isTrue(classes2.contains(cls2), "Extra class $cls2 in $lib2"); | 304 Expect.isTrue(classes2.contains(cls2), "Extra class $cls2 in $lib2"); |
305 }); | 305 }); |
306 }); | 306 }); |
307 | 307 |
308 // TODO(johnniwinther): Test the remaining properties of [ElementEnvironment]. | 308 // TODO(johnniwinther): Test the remaining properties of [ElementEnvironment]. |
309 } | 309 } |
OLD | NEW |