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.enum_creator; | 5 library dart2js.resolution.enum_creator; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common_elements.dart' show CommonElements; | 8 import '../common_elements.dart' show CommonElements; |
9 import '../elements/resolution_types.dart'; | 9 import '../elements/resolution_types.dart'; |
10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 builder.emptyStatement()); | 250 builder.emptyStatement()); |
251 | 251 |
252 EnumConstructorElementX constructor = new EnumConstructorElementX( | 252 EnumConstructorElementX constructor = new EnumConstructorElementX( |
253 enumClass, builder.modifiers(isConst: true), constructorNode); | 253 enumClass, builder.modifiers(isConst: true), constructorNode); |
254 | 254 |
255 EnumFormalElementX indexFormal = new EnumFormalElementX(constructor, | 255 EnumFormalElementX indexFormal = new EnumFormalElementX(constructor, |
256 indexDefinition, builder.identifier('index'), indexVariable); | 256 indexDefinition, builder.identifier('index'), indexVariable); |
257 | 257 |
258 EnumFormalElementX nameFormal; | 258 EnumFormalElementX nameFormal; |
259 | 259 |
260 List<Element> parameters = <Element>[indexFormal]; | 260 List<FormalElement> parameters = <FormalElement>[indexFormal]; |
261 List<ResolutionDartType> parameterTypes = <ResolutionDartType>[intType]; | 261 List<ResolutionDartType> parameterTypes = <ResolutionDartType>[intType]; |
262 if (!matchKernelRepresentationForTesting) { | 262 if (!matchKernelRepresentationForTesting) { |
263 nameFormal = new EnumFormalElementX(constructor, nameDefinition, | 263 nameFormal = new EnumFormalElementX(constructor, nameDefinition, |
264 builder.identifier('_name'), nameVariable); | 264 builder.identifier('_name'), nameVariable); |
265 parameters.add(nameFormal); | 265 parameters.add(nameFormal); |
266 parameterTypes.add(stringType); | 266 parameterTypes.add(stringType); |
267 } | 267 } |
268 FunctionSignatureX constructorSignature = new FunctionSignatureX( | 268 FunctionSignatureX constructorSignature = new FunctionSignatureX( |
269 requiredParameters: parameters, | 269 requiredParameters: parameters, |
270 requiredParameterCount: parameters.length, | 270 requiredParameterCount: parameters.length, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 EnumMethodElementX toString = new EnumMethodElementX( | 350 EnumMethodElementX toString = new EnumMethodElementX( |
351 'toString', enumClass, Modifiers.EMPTY, toStringNode); | 351 'toString', enumClass, Modifiers.EMPTY, toStringNode); |
352 FunctionSignatureX toStringSignature = new FunctionSignatureX( | 352 FunctionSignatureX toStringSignature = new FunctionSignatureX( |
353 type: new ResolutionFunctionType(toString, stringType)); | 353 type: new ResolutionFunctionType(toString, stringType)); |
354 toString.functionSignature = toStringSignature; | 354 toString.functionSignature = toStringSignature; |
355 enumClass.addMember(toString, reporter); | 355 enumClass.addMember(toString, reporter); |
356 | 356 |
357 enumClass.enumValues = enumValues; | 357 enumClass.enumValues = enumValues; |
358 } | 358 } |
359 } | 359 } |
OLD | NEW |