Chromium Code Reviews| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 }); | 153 }); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void checkElements( | 156 void checkElements( |
| 157 Compiler compiler1, Compiler compiler2, Element element1, Element element2, | 157 Compiler compiler1, Compiler compiler2, Element element1, Element element2, |
| 158 {bool verbose: false}) { | 158 {bool verbose: false}) { |
| 159 if (element1.isAbstract) return; | 159 if (element1.isAbstract) return; |
| 160 if (element1.isFunction || | 160 if (element1.isFunction || |
| 161 element1.isConstructor || | 161 element1.isConstructor || |
| 162 (element1.isField && element1.isInstanceMember)) { | 162 (element1.isField && element1.isInstanceMember)) { |
| 163 AstElement astElement1 = element1; | 163 AstElement astElement1 = element1; |
|
Siggi Cherem (dart-lang)
2017/06/05 22:27:04
you might be able to delete these locals now.
Emily Fortuna
2017/06/05 22:30:21
oh good point! Thanks.
| |
| 164 AstElement astElement2 = element2; | 164 AstElement astElement2 = element2; |
| 165 ClosureClassMap closureData1 = compiler1.closureToClassMapper | 165 ClosureClassMap closureData1 = |
| 166 .getClosureToClassMapping(astElement1.resolvedAst); | 166 compiler1.closureToClassMapper.getClosureToClassMapping(element1); |
| 167 ClosureClassMap closureData2 = compiler2.closureToClassMapper | 167 ClosureClassMap closureData2 = |
| 168 .getClosureToClassMapping(astElement2.resolvedAst); | 168 compiler2.closureToClassMapper.getClosureToClassMapping(element2); |
| 169 | 169 |
| 170 checkElementIdentities( | 170 checkElementIdentities( |
| 171 closureData1, | 171 closureData1, |
| 172 closureData2, | 172 closureData2, |
| 173 '$element1.closureElement', | 173 '$element1.closureElement', |
| 174 closureData1.closureElement, | 174 closureData1.closureElement, |
| 175 closureData2.closureElement); | 175 closureData2.closureElement); |
| 176 checkElementIdentities( | 176 checkElementIdentities( |
| 177 closureData1, | 177 closureData1, |
| 178 closureData2, | 178 closureData2, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 check(outputUnit1, outputUnit2, 'OutputUnit.isMainOutput $message', | 296 check(outputUnit1, outputUnit2, 'OutputUnit.isMainOutput $message', |
| 297 outputUnit1.isMainOutput, outputUnit2.isMainOutput); | 297 outputUnit1.isMainOutput, outputUnit2.isMainOutput); |
| 298 checkSetEquivalence( | 298 checkSetEquivalence( |
| 299 outputUnit1, | 299 outputUnit1, |
| 300 outputUnit2, | 300 outputUnit2, |
| 301 'OutputUnit.imports $message', | 301 'OutputUnit.imports $message', |
| 302 outputUnit1.imports, | 302 outputUnit1.imports, |
| 303 outputUnit2.imports, | 303 outputUnit2.imports, |
| 304 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); | 304 (a, b) => areElementsEquivalent(a.declaration, b.declaration)); |
| 305 } | 305 } |
| OLD | NEW |