| 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 library summary_resynthesizer; | 5 library summary_resynthesizer; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/token.dart'; | 10 import 'package:analyzer/dart/ast/token.dart'; |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 /** | 1055 /** |
| 1056 * Resynthesize a [ConstructorElement] and place it in the given [holder]. | 1056 * Resynthesize a [ConstructorElement] and place it in the given [holder]. |
| 1057 * [classType] is the type of the class for which this element is a | 1057 * [classType] is the type of the class for which this element is a |
| 1058 * constructor. | 1058 * constructor. |
| 1059 */ | 1059 */ |
| 1060 void buildConstructor(UnlinkedExecutable serializedExecutable, | 1060 void buildConstructor(UnlinkedExecutable serializedExecutable, |
| 1061 ElementHolder holder, InterfaceType classType) { | 1061 ElementHolder holder, InterfaceType classType) { |
| 1062 assert(serializedExecutable.kind == UnlinkedExecutableKind.constructor); | 1062 assert(serializedExecutable.kind == UnlinkedExecutableKind.constructor); |
| 1063 currentConstructor = new ConstructorElementImpl( | 1063 currentConstructor = new ConstructorElementImpl( |
| 1064 serializedExecutable.name, serializedExecutable.nameOffset); | 1064 serializedExecutable.name, serializedExecutable.nameOffset); |
| 1065 if (serializedExecutable.name.isEmpty) { |
| 1066 currentConstructor.nameEnd = |
| 1067 serializedExecutable.nameOffset + classType.name.length; |
| 1068 } else { |
| 1069 currentConstructor.nameEnd = serializedExecutable.nameEnd; |
| 1070 currentConstructor.periodOffset = serializedExecutable.periodOffset; |
| 1071 } |
| 1065 constructors[serializedExecutable.name] = currentConstructor; | 1072 constructors[serializedExecutable.name] = currentConstructor; |
| 1066 currentConstructor.returnType = classType; | 1073 currentConstructor.returnType = classType; |
| 1067 buildExecutableCommonParts(currentConstructor, serializedExecutable); | 1074 buildExecutableCommonParts(currentConstructor, serializedExecutable); |
| 1068 currentConstructor.factory = serializedExecutable.isFactory; | 1075 currentConstructor.factory = serializedExecutable.isFactory; |
| 1069 currentConstructor.const2 = serializedExecutable.isConst; | 1076 currentConstructor.const2 = serializedExecutable.isConst; |
| 1070 currentConstructor.constantInitializers = serializedExecutable | 1077 currentConstructor.constantInitializers = serializedExecutable |
| 1071 .constantInitializers | 1078 .constantInitializers |
| 1072 .map(buildConstantInitializer) | 1079 .map(buildConstantInitializer) |
| 1073 .toList(); | 1080 .toList(); |
| 1074 if (serializedExecutable.isRedirectedConstructor) { | 1081 if (serializedExecutable.isRedirectedConstructor) { |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2412 List<DartType> typeArguments = const <DartType>[]; | 2419 List<DartType> typeArguments = const <DartType>[]; |
| 2413 if (numTypeArguments != 0) { | 2420 if (numTypeArguments != 0) { |
| 2414 typeArguments = <DartType>[]; | 2421 typeArguments = <DartType>[]; |
| 2415 for (int i = 0; i < numTypeArguments; i++) { | 2422 for (int i = 0; i < numTypeArguments; i++) { |
| 2416 typeArguments.add(getTypeArgument(i)); | 2423 typeArguments.add(getTypeArgument(i)); |
| 2417 } | 2424 } |
| 2418 } | 2425 } |
| 2419 return typeArguments; | 2426 return typeArguments; |
| 2420 } | 2427 } |
| 2421 } | 2428 } |
| OLD | NEW |