| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 modifiers: modifiersString, | 355 modifiers: modifiersString, |
| 356 contents: contents); | 356 contents: contents); |
| 357 } | 357 } |
| 358 | 358 |
| 359 InfoNode visitFunctionElement(FunctionElement element) { | 359 InfoNode visitFunctionElement(FunctionElement element) { |
| 360 CodeBuffer emittedCode = compiler.backend.codeOf(element); | 360 CodeBuffer emittedCode = compiler.backend.codeOf(element); |
| 361 int size = 0; | 361 int size = 0; |
| 362 String nameString = element.name; | 362 String nameString = element.name; |
| 363 String modifiersString = "${element.modifiers}"; | 363 String modifiersString = "${element.modifiers}"; |
| 364 String kindString = "function"; | 364 String kindString = "function"; |
| 365 if (currentElement.isClass()) { | 365 if (currentElement.isClass) { |
| 366 kindString = "method"; | 366 kindString = "method"; |
| 367 } else if (currentElement.isField() || | 367 } else if (currentElement.isField || |
| 368 currentElement.isFunction() || | 368 currentElement.isFunction || |
| 369 currentElement.isConstructor()) { | 369 currentElement.isConstructor) { |
| 370 kindString = "closure"; | 370 kindString = "closure"; |
| 371 nameString = "<unnamed>"; | 371 nameString = "<unnamed>"; |
| 372 } | 372 } |
| 373 if (element.isConstructor()) { | 373 if (element.isConstructor) { |
| 374 nameString = element.name == "" | 374 nameString = element.name == "" |
| 375 ? "${element.enclosingElement.name}" | 375 ? "${element.enclosingElement.name}" |
| 376 : "${element.enclosingElement.name}.${element.name}"; | 376 : "${element.enclosingElement.name}.${element.name}"; |
| 377 kindString = "constructor"; | 377 kindString = "constructor"; |
| 378 } | 378 } |
| 379 List contents = []; | 379 List contents = []; |
| 380 if (emittedCode != null) { | 380 if (emittedCode != null) { |
| 381 FunctionSignature signature = element.functionSignature; | 381 FunctionSignature signature = element.functionSignature; |
| 382 signature.forEachParameter((parameter) { | 382 signature.forEachParameter((parameter) { |
| 383 contents.add(new InferredInfoNode( | 383 contents.add(new InferredInfoNode( |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 } | 589 } |
| 590 document.querySelector('.sort_by_size').addEventListener('click', | 590 document.querySelector('.sort_by_size').addEventListener('click', |
| 591 function() { | 591 function() { |
| 592 sortBySize(); | 592 sortBySize(); |
| 593 }, false); | 593 }, false); |
| 594 </script> | 594 </script> |
| 595 </body> | 595 </body> |
| 596 </html>"""); | 596 </html>"""); |
| 597 } | 597 } |
| 598 } | 598 } |
| OLD | NEW |