| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /** | 5 /** |
| 6 * Code generation for the file "integration_test_methods.dart". | 6 * Code generation for the file "integration_test_methods.dart". |
| 7 */ | 7 */ |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/codegen/tools.dart'; | 10 import 'package:analyzer/src/codegen/tools.dart'; |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 206 } |
| 207 if (optionalArgs.isNotEmpty) { | 207 if (optionalArgs.isNotEmpty) { |
| 208 args.add('{${optionalArgs.join(', ')}}'); | 208 args.add('{${optionalArgs.join(', ')}}'); |
| 209 } | 209 } |
| 210 writeln(); | 210 writeln(); |
| 211 docComment(toHtmlVisitor.collectHtml(() { | 211 docComment(toHtmlVisitor.collectHtml(() { |
| 212 toHtmlVisitor.translateHtml(request.html); | 212 toHtmlVisitor.translateHtml(request.html); |
| 213 toHtmlVisitor.describePayload(request.params, 'Parameters'); | 213 toHtmlVisitor.describePayload(request.params, 'Parameters'); |
| 214 toHtmlVisitor.describePayload(request.result, 'Returns'); | 214 toHtmlVisitor.describePayload(request.result, 'Returns'); |
| 215 })); | 215 })); |
| 216 if (request.deprecated) { |
| 217 writeln('@deprecated'); |
| 218 } |
| 216 String resultClass; | 219 String resultClass; |
| 217 String futureClass; | 220 String futureClass; |
| 218 if (request.result == null) { | 221 if (request.result == null) { |
| 219 futureClass = 'Future'; | 222 futureClass = 'Future'; |
| 220 } else { | 223 } else { |
| 221 resultClass = camelJoin([request.domainName, request.method, 'result'], | 224 resultClass = camelJoin([request.domainName, request.method, 'result'], |
| 222 doCapitalize: true); | 225 doCapitalize: true); |
| 223 futureClass = 'Future<$resultClass>'; | 226 futureClass = 'Future<$resultClass>'; |
| 224 } | 227 } |
| 225 writeln('$futureClass $methodName(${args.join(', ')}) async {'); | 228 writeln('$futureClass $methodName(${args.join(', ')}) async {'); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 252 writeln('ResponseDecoder decoder = new ResponseDecoder($kind);'); | 255 writeln('ResponseDecoder decoder = new ResponseDecoder($kind);'); |
| 253 writeln("return new $resultClass.fromJson(decoder, 'result', result);"); | 256 writeln("return new $resultClass.fromJson(decoder, 'result', result);"); |
| 254 } else { | 257 } else { |
| 255 writeln('outOfTestExpect(result, isNull);'); | 258 writeln('outOfTestExpect(result, isNull);'); |
| 256 writeln('return null;'); | 259 writeln('return null;'); |
| 257 } | 260 } |
| 258 }); | 261 }); |
| 259 writeln('}'); | 262 writeln('}'); |
| 260 } | 263 } |
| 261 } | 264 } |
| OLD | NEW |