| 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 '../core_types.dart' show | 7 import '../core_types.dart' show |
| 8 CoreTypes; | 8 CoreTypes; |
| 9 import '../dart_types.dart'; | 9 import '../dart_types.dart'; |
| 10 import '../diagnostics/diagnostic_listener.dart' show | 10 import '../diagnostics/diagnostic_listener.dart' show |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 constructor, | 226 constructor, |
| 227 indexDefinition, | 227 indexDefinition, |
| 228 builder.identifier('index'), | 228 builder.identifier('index'), |
| 229 indexVariable); | 229 indexVariable); |
| 230 | 230 |
| 231 FunctionSignatureX constructorSignature = new FunctionSignatureX( | 231 FunctionSignatureX constructorSignature = new FunctionSignatureX( |
| 232 requiredParameters: [indexFormal], | 232 requiredParameters: [indexFormal], |
| 233 requiredParameterCount: 1, | 233 requiredParameterCount: 1, |
| 234 type: new FunctionType(constructor, const VoidType(), | 234 type: new FunctionType(constructor, const VoidType(), |
| 235 <DartType>[intType])); | 235 <DartType>[intType])); |
| 236 constructor.functionSignatureCache = constructorSignature; | 236 constructor.functionSignature = constructorSignature; |
| 237 enumClass.addMember(constructor, reporter); | 237 enumClass.addMember(constructor, reporter); |
| 238 | 238 |
| 239 List<FieldElement> enumValues = <FieldElement>[]; | 239 List<FieldElement> enumValues = <FieldElement>[]; |
| 240 VariableList variableList = | 240 VariableList variableList = |
| 241 new VariableList(builder.modifiers(isStatic: true, isConst: true)); | 241 new VariableList(builder.modifiers(isStatic: true, isConst: true)); |
| 242 variableList.type = enumType; | 242 variableList.type = enumType; |
| 243 int index = 0; | 243 int index = 0; |
| 244 List<Node> valueReferences = <Node>[]; | 244 List<Node> valueReferences = <Node>[]; |
| 245 List<LiteralMapEntry> mapEntries = <LiteralMapEntry>[]; | 245 List<LiteralMapEntry> mapEntries = <LiteralMapEntry>[]; |
| 246 for (Link<Node> link = node.names.nodes; | 246 for (Link<Node> link = node.names.nodes; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 builder.indexGet( | 297 builder.indexGet( |
| 298 builder.mapLiteral(mapEntries, isConst: true), | 298 builder.mapLiteral(mapEntries, isConst: true), |
| 299 builder.reference(builder.identifier('index'))) | 299 builder.reference(builder.identifier('index'))) |
| 300 ) | 300 ) |
| 301 ); | 301 ); |
| 302 | 302 |
| 303 EnumMethodElementX toString = new EnumMethodElementX('toString', | 303 EnumMethodElementX toString = new EnumMethodElementX('toString', |
| 304 enumClass, Modifiers.EMPTY, toStringNode); | 304 enumClass, Modifiers.EMPTY, toStringNode); |
| 305 FunctionSignatureX toStringSignature = new FunctionSignatureX( | 305 FunctionSignatureX toStringSignature = new FunctionSignatureX( |
| 306 type: new FunctionType(toString, stringType)); | 306 type: new FunctionType(toString, stringType)); |
| 307 toString.functionSignatureCache = toStringSignature; | 307 toString.functionSignature = toStringSignature; |
| 308 enumClass.addMember(toString, reporter); | 308 enumClass.addMember(toString, reporter); |
| 309 | 309 |
| 310 enumClass.enumValues = enumValues; | 310 enumClass.enumValues = enumValues; |
| 311 } | 311 } |
| 312 } | 312 } |
| OLD | NEW |