OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dump_info; | 5 library dump_info; |
6 | 6 |
7 import 'elements/elements.dart'; | 7 import 'elements/elements.dart'; |
8 import 'elements/visitor.dart'; | 8 import 'elements/visitor.dart'; |
9 import 'dart:convert' show HtmlEscape; | 9 import 'dart:convert' show HtmlEscape; |
10 import 'dart2jslib.dart' show | 10 import 'dart2jslib.dart' show |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 token: element.position()); | 227 token: element.position()); |
228 return null; | 228 return null; |
229 } | 229 } |
230 | 230 |
231 InfoNode visitLibraryElement(LibraryElement element) { | 231 InfoNode visitLibraryElement(LibraryElement element) { |
232 List<InfoNode> contents = new List<InfoNode>(); | 232 List<InfoNode> contents = new List<InfoNode>(); |
233 int size = compiler.dumpInfoTask.codeSizeCounter | 233 int size = compiler.dumpInfoTask.codeSizeCounter |
234 .getGeneratedSizeOf(element); | 234 .getGeneratedSizeOf(element); |
235 if (size == 0) return null; | 235 if (size == 0) return null; |
236 stack.add(element); | 236 stack.add(element); |
237 element.forEachLocalMember((Element member) { | 237 // For some reason the patch library contains the origin libraries members, |
| 238 // but the origin library does not contain the patch members. |
| 239 LibraryElement contentsLibrary = element.isPatched |
| 240 ? element.patch |
| 241 : element; |
| 242 contentsLibrary.forEachLocalMember((Element member) { |
238 InfoNode info = member.accept(this); | 243 InfoNode info = member.accept(this); |
239 if (info != null) { | 244 if (info != null) { |
240 contents.add(info); | 245 contents.add(info); |
241 } | 246 } |
242 }); | 247 }); |
243 stack.removeLast(); | 248 stack.removeLast(); |
244 String nameString = element.getLibraryName() == "" | 249 String nameString = element.getLibraryName() == "" |
245 ? "<unnamed>" | 250 ? "<unnamed>" |
246 : element.getLibraryName(); | 251 : element.getLibraryName(); |
247 contents.sort((InfoNode e1, InfoNode e2) { | 252 contents.sort((InfoNode e1, InfoNode e2) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 var container = containers[i]; | 508 var container = containers[i]; |
504 container.addEventListener('click', | 509 container.addEventListener('click', |
505 toggler(container.nextElementSibling), false); | 510 toggler(container.nextElementSibling), false); |
506 container.nextElementSibling.hidden = true; | 511 container.nextElementSibling.hidden = true; |
507 }; | 512 }; |
508 </script> | 513 </script> |
509 </body> | 514 </body> |
510 </html>"""); | 515 </html>"""); |
511 } | 516 } |
512 } | 517 } |
OLD | NEW |