| 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.serialization_model_test; | 5 library dart2js.serialization_model_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
| 10 import 'package:compiler/src/closure.dart'; | 10 import 'package:compiler/src/closure.dart'; |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 if (a == null || b == null) return false; | 234 if (a == null || b == null) return false; |
| 235 | 235 |
| 236 if (a is Element) { | 236 if (a is Element) { |
| 237 return b is Element && areElementsEquivalent(a as Element, b as Element); | 237 return b is Element && areElementsEquivalent(a as Element, b as Element); |
| 238 } else { | 238 } else { |
| 239 return a.runtimeType == b.runtimeType && | 239 return a.runtimeType == b.runtimeType && |
| 240 areElementsEquivalent(a.executableContext, b.executableContext); | 240 areElementsEquivalent(a.executableContext, b.executableContext); |
| 241 } | 241 } |
| 242 } | 242 } |
| 243 | 243 |
| 244 bool areCapturedVariablesEquivalent(CapturedVariable a, CapturedVariable b) { | 244 bool areCapturedVariablesEquivalent(FieldEntity a, FieldEntity b) { |
| 245 if (a == b) return true; | 245 if (a == b) return true; |
| 246 if (a == null || b == null) return false; | 246 if (a == null || b == null) return false; |
| 247 if (a is ClosureFieldElement && b is ClosureFieldElement) { | 247 if (a is ClosureFieldElement && b is ClosureFieldElement) { |
| 248 return areElementsEquivalent(a.closureClass, b.closureClass) && | 248 return areElementsEquivalent(a.closureClass, b.closureClass) && |
| 249 areLocalsEquivalent(a.local, b.local); | 249 areLocalsEquivalent(a.local, b.local); |
| 250 } else if (a is BoxFieldElement && b is BoxFieldElement) { | 250 } else if (a is BoxFieldElement && b is BoxFieldElement) { |
| 251 return areElementsEquivalent(a.variableElement, b.variableElement) && | 251 return areElementsEquivalent(a.variableElement, b.variableElement) && |
| 252 areLocalsEquivalent(a.box, b.box); | 252 areLocalsEquivalent(a.box, b.box); |
| 253 } | 253 } |
| 254 return false; | 254 return false; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 check(outputUnit1, outputUnit2, 'OutputUnit.isMainOutput $message', | 294 check(outputUnit1, outputUnit2, 'OutputUnit.isMainOutput $message', |
| 295 outputUnit1.isMainOutput, outputUnit2.isMainOutput); | 295 outputUnit1.isMainOutput, outputUnit2.isMainOutput); |
| 296 checkSetEquivalence( | 296 checkSetEquivalence( |
| 297 outputUnit1, | 297 outputUnit1, |
| 298 outputUnit2, | 298 outputUnit2, |
| 299 'OutputUnit.imports $message', | 299 'OutputUnit.imports $message', |
| 300 outputUnit1.imports, | 300 outputUnit1.imports, |
| 301 outputUnit2.imports, | 301 outputUnit2.imports, |
| 302 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); | 302 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); |
| 303 } | 303 } |
| OLD | NEW |