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 /// Equivalence test functions for data objects. | 5 /// Equivalence test functions for data objects. |
6 | 6 |
7 library dart2js.equivalence.functions; | 7 library dart2js.equivalence.functions; |
8 | 8 |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import 'package:compiler/src/common/resolution.dart'; | 10 import 'package:compiler/src/common/resolution.dart'; |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 void checkNativeClasses( | 357 void checkNativeClasses( |
358 Compiler compiler1, Compiler compiler2, TestStrategy strategy) { | 358 Compiler compiler1, Compiler compiler2, TestStrategy strategy) { |
359 Iterable<ClassEntity> nativeClasses1 = compiler1 | 359 Iterable<ClassEntity> nativeClasses1 = compiler1 |
360 .backend.nativeResolutionEnqueuerForTesting.nativeClassesForTesting; | 360 .backend.nativeResolutionEnqueuerForTesting.nativeClassesForTesting; |
361 Iterable<ClassEntity> nativeClasses2 = compiler2 | 361 Iterable<ClassEntity> nativeClasses2 = compiler2 |
362 .backend.nativeResolutionEnqueuerForTesting.nativeClassesForTesting; | 362 .backend.nativeResolutionEnqueuerForTesting.nativeClassesForTesting; |
363 | 363 |
364 checkSetEquivalence(compiler1, compiler2, 'nativeClasses', nativeClasses1, | 364 checkSetEquivalence(compiler1, compiler2, 'nativeClasses', nativeClasses1, |
365 nativeClasses2, strategy.elementEquivalence); | 365 nativeClasses2, strategy.elementEquivalence); |
366 | 366 |
367 Iterable<ClassEntity> registeredClasses1 = compiler1 | 367 Iterable<ClassEntity> liveNativeClasses1 = |
368 .backend.nativeResolutionEnqueuerForTesting.registeredClassesForTesting; | 368 compiler1.backend.nativeResolutionEnqueuerForTesting.liveNativeClasses; |
369 Iterable<ClassEntity> registeredClasses2 = compiler2 | 369 Iterable<ClassEntity> liveNativeClasses2 = |
370 .backend.nativeResolutionEnqueuerForTesting.registeredClassesForTesting; | 370 compiler2.backend.nativeResolutionEnqueuerForTesting.liveNativeClasses; |
371 | 371 |
372 checkSetEquivalence(compiler1, compiler2, 'registeredClasses', | 372 checkSetEquivalence(compiler1, compiler2, 'liveNativeClasses', |
373 registeredClasses1, registeredClasses2, strategy.elementEquivalence); | 373 liveNativeClasses1, liveNativeClasses2, strategy.elementEquivalence); |
374 } | 374 } |
375 | 375 |
376 void checkNativeBasicData(NativeBasicDataImpl data1, NativeBasicDataImpl data2, | 376 void checkNativeBasicData(NativeBasicDataImpl data1, NativeBasicDataImpl data2, |
377 TestStrategy strategy) { | 377 TestStrategy strategy) { |
378 checkMapEquivalence( | 378 checkMapEquivalence( |
379 data1, | 379 data1, |
380 data2, | 380 data2, |
381 'nativeClassTagInfo', | 381 'nativeClassTagInfo', |
382 data1.nativeClassTagInfo, | 382 data1.nativeClassTagInfo, |
383 data2.nativeClassTagInfo, | 383 data2.nativeClassTagInfo, |
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 return testNodes(node.expression, other.expression); | 1408 return testNodes(node.expression, other.expression); |
1409 } | 1409 } |
1410 | 1410 |
1411 @override | 1411 @override |
1412 bool visitBlock(js.Block node) { | 1412 bool visitBlock(js.Block node) { |
1413 if (peek() is! js.Block) return failAt(node, peek()); | 1413 if (peek() is! js.Block) return failAt(node, peek()); |
1414 js.Block other = peek(); | 1414 js.Block other = peek(); |
1415 return testNodeLists(node.statements, other.statements); | 1415 return testNodeLists(node.statements, other.statements); |
1416 } | 1416 } |
1417 } | 1417 } |
OLD | NEW |