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 ChunkedConversionSink, JsonEncoder, StringConversionSink; | 8 show ChunkedConversionSink, JsonEncoder, StringConversionSink; |
9 | 9 |
10 import 'package:dart2js_info/info.dart'; | 10 import 'package:dart2js_info/info.dart'; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 FunctionModifiers modifiers = new FunctionModifiers( | 256 FunctionModifiers modifiers = new FunctionModifiers( |
257 isStatic: element.isStatic, | 257 isStatic: element.isStatic, |
258 isConst: element.isConst, | 258 isConst: element.isConst, |
259 isFactory: element.isFactoryConstructor, | 259 isFactory: element.isFactoryConstructor, |
260 isExternal: element.isPatched); | 260 isExternal: element.isPatched); |
261 String code = compiler.dumpInfoTask.codeOf(element); | 261 String code = compiler.dumpInfoTask.codeOf(element); |
262 | 262 |
263 String returnType = null; | 263 String returnType = null; |
264 List<ParameterInfo> parameters = <ParameterInfo>[]; | 264 List<ParameterInfo> parameters = <ParameterInfo>[]; |
265 if (element.hasFunctionSignature) { | 265 if (element.hasFunctionSignature) { |
266 FunctionSignature signature = element.functionSignature; | 266 FunctionElement implementation = element.implementation; |
| 267 FunctionSignature signature = implementation.functionSignature; |
267 signature.forEachParameter((parameter) { | 268 signature.forEachParameter((parameter) { |
268 parameters.add(new ParameterInfo(parameter.name, | 269 parameters.add(new ParameterInfo(parameter.name, |
269 '${_resultOfParameter(parameter).type}', '${parameter.node.type}')); | 270 '${_resultOfParameter(parameter).type}', '${parameter.node.type}')); |
270 }); | 271 }); |
271 returnType = '${element.type.returnType}'; | 272 returnType = '${element.type.returnType}'; |
272 } | 273 } |
273 | 274 |
274 MethodElement method; | 275 MethodElement method; |
275 if (element is LocalFunctionElement) { | 276 if (element is LocalFunctionElement) { |
276 method = element.callMethod; | 277 method = element.callMethod; |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 | 619 |
619 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( | 620 ChunkedConversionSink<Object> sink = encoder.startChunkedConversion( |
620 new StringConversionSink.fromStringSink(buffer)); | 621 new StringConversionSink.fromStringSink(buffer)); |
621 sink.add(new AllInfoJsonCodec().encode(result)); | 622 sink.add(new AllInfoJsonCodec().encode(result)); |
622 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { | 623 compiler.reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, { |
623 'text': "View the dumped .info.json file at " | 624 'text': "View the dumped .info.json file at " |
624 "https://dart-lang.github.io/dump-info-visualizer" | 625 "https://dart-lang.github.io/dump-info-visualizer" |
625 }); | 626 }); |
626 } | 627 } |
627 } | 628 } |
OLD | NEW |