| 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 'dart:convert' | 7 import 'dart:convert' |
| 8 show HtmlEscape, JsonEncoder, StringConversionSink, ChunkedConversionSink; | 8 show HtmlEscape, JsonEncoder, StringConversionSink, ChunkedConversionSink; |
| 9 | 9 |
| 10 import 'package:dart2js_info/info.dart'; | 10 import 'package:dart2js_info/info.dart'; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 assert(false); | 108 assert(false); |
| 109 } | 109 } |
| 110 }); | 110 }); |
| 111 | 111 |
| 112 if (info.isEmpty && !shouldKeep(element)) return null; | 112 if (info.isEmpty && !shouldKeep(element)) return null; |
| 113 result.libraries.add(info); | 113 result.libraries.add(info); |
| 114 return info; | 114 return info; |
| 115 } | 115 } |
| 116 | 116 |
| 117 TypedefInfo visitTypedefElement(TypedefElement element, _) { | 117 TypedefInfo visitTypedefElement(TypedefElement element, _) { |
| 118 if (element.alias == null) return null; | 118 if (!element.isResolved) return null; |
| 119 TypedefInfo info = new TypedefInfo(element.name, '${element.alias}', | 119 TypedefInfo info = new TypedefInfo(element.name, '${element.alias}', |
| 120 _unitInfoForElement(element)); | 120 _unitInfoForElement(element)); |
| 121 _elementToInfo[element] = info; | 121 _elementToInfo[element] = info; |
| 122 result.typedefs.add(info); | 122 result.typedefs.add(info); |
| 123 return info; | 123 return info; |
| 124 } | 124 } |
| 125 | 125 |
| 126 FieldInfo visitFieldElement(FieldElement element, _) { | 126 FieldInfo visitFieldElement(FieldElement element, _) { |
| 127 TypeMask inferredType = | 127 TypeMask inferredType = |
| 128 compiler.typesTask.getGuaranteedTypeOfElement(element); | 128 compiler.typesTask.getGuaranteedTypeOfElement(element); |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 | 559 |
| 560 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 560 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
| 561 new StringConversionSink.fromStringSink(buffer)); | 561 new StringConversionSink.fromStringSink(buffer)); |
| 562 sink.add(result.toJson()); | 562 sink.add(result.toJson()); |
| 563 reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 563 reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
| 564 'text': "View the dumped .info.json file at " | 564 'text': "View the dumped .info.json file at " |
| 565 "https://dart-lang.github.io/dump-info-visualizer" | 565 "https://dart-lang.github.io/dump-info-visualizer" |
| 566 }); | 566 }); |
| 567 } | 567 } |
| 568 } | 568 } |
| OLD | NEW |