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 /// Data produced by dart2js when run with the `--dump-info` flag. | 5 /// Data produced by dart2js when run with the `--dump-info` flag. |
6 library dart2js_info.info; | 6 library dart2js_info.info; |
7 | 7 |
8 import 'src/measurements.dart'; | 8 import 'src/measurements.dart'; |
9 export 'src/measurements.dart'; | 9 export 'src/measurements.dart'; |
10 | 10 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 /// Minor version indicating non-breaking changes in the format. A change in | 144 /// Minor version indicating non-breaking changes in the format. A change in |
145 /// this version number means that the json parsing in this library from a | 145 /// this version number means that the json parsing in this library from a |
146 /// previous will continue to work after the change. This is typically | 146 /// previous will continue to work after the change. This is typically |
147 /// increased when adding new entries to the file format. | 147 /// increased when adding new entries to the file format. |
148 // Note: the dump-info.viewer app was written using a json parser version 3.2. | 148 // Note: the dump-info.viewer app was written using a json parser version 3.2. |
149 final int minorVersion = 6; | 149 final int minorVersion = 6; |
150 | 150 |
151 AllInfo(); | 151 AllInfo(); |
152 | 152 |
153 static AllInfo parseFromJson(Map map) => new _ParseHelper().parseAll(map); | 153 // TODO(het): Remove this when we have an external InfoCodec, see |
| 154 // https://github.com/dart-lang/dart2js_info/issues/4 |
| 155 factory AllInfo.fromJson(Map json) => new _ParseHelper().parseAll(json); |
154 | 156 |
155 Map _listAsJsonMap(List<Info> list) { | 157 Map _listAsJsonMap(List<Info> list) { |
156 var map = <String, Map>{}; | 158 var map = <String, Map>{}; |
157 for (var info in list) { | 159 for (var info in list) { |
158 map['${info.id}'] = info.toJson(); | 160 map['${info.id}'] = info.toJson(); |
159 } | 161 } |
160 return map; | 162 return map; |
161 } | 163 } |
162 | 164 |
163 Map _extractHoldingInfo() { | 165 Map _extractHoldingInfo() { |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 } | 852 } |
851 | 853 |
852 visitField(FieldInfo info) { | 854 visitField(FieldInfo info) { |
853 info.closures.forEach(visitFunction); | 855 info.closures.forEach(visitFunction); |
854 } | 856 } |
855 | 857 |
856 visitFunction(FunctionInfo info) { | 858 visitFunction(FunctionInfo info) { |
857 info.closures.forEach(visitFunction); | 859 info.closures.forEach(visitFunction); |
858 } | 860 } |
859 } | 861 } |
OLD | NEW |