| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.resolution.signatures; | 5 library dart2js.resolution.signatures; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../compiler.dart' show | 8 import '../compiler.dart' show |
| 9 Compiler; | 9 Compiler; |
| 10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 LinkBuilder<Element> parametersBuilder = | 335 LinkBuilder<Element> parametersBuilder = |
| 336 visitor.analyzeNodes(formalParameters.nodes); | 336 visitor.analyzeNodes(formalParameters.nodes); |
| 337 requiredParameterCount = parametersBuilder.length; | 337 requiredParameterCount = parametersBuilder.length; |
| 338 parameters = parametersBuilder.toList(); | 338 parameters = parametersBuilder.toList(); |
| 339 } | 339 } |
| 340 DartType returnType; | 340 DartType returnType; |
| 341 if (element.isFactoryConstructor) { | 341 if (element.isFactoryConstructor) { |
| 342 returnType = element.enclosingClass.thisType; | 342 returnType = element.enclosingClass.thisType; |
| 343 // Because there is no type annotation for the return type of | 343 // Because there is no type annotation for the return type of |
| 344 // this element, we explicitly add one. | 344 // this element, we explicitly add one. |
| 345 if (compiler.enableTypeAssertions) { | 345 if (compiler.options.enableTypeAssertions) { |
| 346 registry.registerTypeUse(new TypeUse.checkedModeCheck(returnType)); | 346 registry.registerTypeUse(new TypeUse.checkedModeCheck(returnType)); |
| 347 } | 347 } |
| 348 } else { | 348 } else { |
| 349 AsyncMarker asyncMarker = AsyncMarker.SYNC; | 349 AsyncMarker asyncMarker = AsyncMarker.SYNC; |
| 350 if (isFunctionExpression) { | 350 if (isFunctionExpression) { |
| 351 // Use async marker to determine the return type of function | 351 // Use async marker to determine the return type of function |
| 352 // expressions. | 352 // expressions. |
| 353 FunctionElement function = element; | 353 FunctionElement function = element; |
| 354 asyncMarker = function.asyncMarker; | 354 asyncMarker = function.asyncMarker; |
| 355 } | 355 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 439 |
| 440 DartType resolveReturnType(TypeAnnotation annotation) { | 440 DartType resolveReturnType(TypeAnnotation annotation) { |
| 441 if (annotation == null) return const DynamicType(); | 441 if (annotation == null) return const DynamicType(); |
| 442 DartType result = resolver.resolveTypeAnnotation(annotation); | 442 DartType result = resolver.resolveTypeAnnotation(annotation); |
| 443 if (result == null) { | 443 if (result == null) { |
| 444 return const DynamicType(); | 444 return const DynamicType(); |
| 445 } | 445 } |
| 446 return result; | 446 return result; |
| 447 } | 447 } |
| 448 } | 448 } |
| OLD | NEW |