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 'dart:io'; | 8 import 'dart:io'; |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 verbose: verbose); | 131 verbose: verbose); |
132 } | 132 } |
133 | 133 |
134 void checkElements( | 134 void checkElements( |
135 Compiler compiler1, Compiler compiler2, | 135 Compiler compiler1, Compiler compiler2, |
136 Element element1, Element element2, | 136 Element element1, Element element2, |
137 {bool verbose: false}) { | 137 {bool verbose: false}) { |
138 if (element1.isFunction || | 138 if (element1.isFunction || |
139 element1.isConstructor || | 139 element1.isConstructor || |
140 (element1.isField && element1.isInstanceMember)) { | 140 (element1.isField && element1.isInstanceMember)) { |
| 141 AstElement astElement1 = element1; |
| 142 AstElement astElement2 = element2; |
141 ClosureClassMap closureData1 = | 143 ClosureClassMap closureData1 = |
142 compiler1.closureToClassMapper.computeClosureToClassMapping( | 144 compiler1.closureToClassMapper.computeClosureToClassMapping( |
143 compiler1.backend.frontend.getResolvedAst(element1.declaration)); | 145 astElement1.resolvedAst); |
144 ClosureClassMap closureData2 = | 146 ClosureClassMap closureData2 = |
145 compiler2.closureToClassMapper.computeClosureToClassMapping( | 147 compiler2.closureToClassMapper.computeClosureToClassMapping( |
146 compiler2.backend.frontend.getResolvedAst(element2.declaration)); | 148 astElement2.resolvedAst); |
147 | 149 |
148 checkElementIdentities(closureData1, closureData2, | 150 checkElementIdentities(closureData1, closureData2, |
149 '$element1.closureElement', | 151 '$element1.closureElement', |
150 closureData1.closureElement, closureData2.closureElement); | 152 closureData1.closureElement, closureData2.closureElement); |
151 checkElementIdentities(closureData1, closureData2, | 153 checkElementIdentities(closureData1, closureData2, |
152 '$element1.closureClassElement', | 154 '$element1.closureClassElement', |
153 closureData1.closureClassElement, closureData2.closureClassElement); | 155 closureData1.closureClassElement, closureData2.closureClassElement); |
154 checkElementIdentities(closureData1, closureData2, | 156 checkElementIdentities(closureData1, closureData2, |
155 '$element1.callElement', | 157 '$element1.callElement', |
156 closureData1.callElement, closureData2.callElement); | 158 closureData1.callElement, closureData2.callElement); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 return true; | 402 return true; |
401 } | 403 } |
402 | 404 |
403 String nodeToString(Node node) { | 405 String nodeToString(Node node) { |
404 String text = '$node'; | 406 String text = '$node'; |
405 if (text.length > 40) { | 407 if (text.length > 40) { |
406 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; | 408 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; |
407 } | 409 } |
408 return '(${node.runtimeType}) $text'; | 410 return '(${node.runtimeType}) $text'; |
409 } | 411 } |
OLD | NEW |