| 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 '../dart_types.dart'; | 7 import '../dart_types.dart'; |
| 8 import '../dart2jslib.dart'; | 8 import '../dart2jslib.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../elements/modelx.dart'; | 10 import '../elements/modelx.dart'; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 builder.modifiers(isConst: true), | 214 builder.modifiers(isConst: true), |
| 215 constructorNode); | 215 constructorNode); |
| 216 | 216 |
| 217 EnumFormalElementX indexFormal = new EnumFormalElementX( | 217 EnumFormalElementX indexFormal = new EnumFormalElementX( |
| 218 constructor, | 218 constructor, |
| 219 indexDefinition, | 219 indexDefinition, |
| 220 builder.identifier('index'), | 220 builder.identifier('index'), |
| 221 indexVariable); | 221 indexVariable); |
| 222 | 222 |
| 223 FunctionSignatureX constructorSignature = new FunctionSignatureX( | 223 FunctionSignatureX constructorSignature = new FunctionSignatureX( |
| 224 requiredParameters: builder.linkedList([indexFormal]), | 224 requiredParameters: [indexFormal], |
| 225 requiredParameterCount: 1, | 225 requiredParameterCount: 1, |
| 226 type: new FunctionType(constructor, const VoidType(), | 226 type: new FunctionType(constructor, const VoidType(), |
| 227 <DartType>[intType])); | 227 <DartType>[intType])); |
| 228 constructor.functionSignatureCache = constructorSignature; | 228 constructor.functionSignatureCache = constructorSignature; |
| 229 enumClass.addMember(constructor, compiler); | 229 enumClass.addMember(constructor, compiler); |
| 230 | 230 |
| 231 List<FieldElement> enumValues = <FieldElement>[]; | 231 List<FieldElement> enumValues = <FieldElement>[]; |
| 232 VariableList variableList = | 232 VariableList variableList = |
| 233 new VariableList(builder.modifiers(isStatic: true, isConst: true)); | 233 new VariableList(builder.modifiers(isStatic: true, isConst: true)); |
| 234 variableList.type = enumType; | 234 variableList.type = enumType; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 EnumMethodElementX toString = new EnumMethodElementX('toString', | 296 EnumMethodElementX toString = new EnumMethodElementX('toString', |
| 297 enumClass, Modifiers.EMPTY, toStringNode); | 297 enumClass, Modifiers.EMPTY, toStringNode); |
| 298 FunctionSignatureX toStringSignature = new FunctionSignatureX( | 298 FunctionSignatureX toStringSignature = new FunctionSignatureX( |
| 299 type: new FunctionType(toString, stringType)); | 299 type: new FunctionType(toString, stringType)); |
| 300 toString.functionSignatureCache = toStringSignature; | 300 toString.functionSignatureCache = toStringSignature; |
| 301 enumClass.addMember(toString, compiler); | 301 enumClass.addMember(toString, compiler); |
| 302 | 302 |
| 303 enumClass.enumValues = enumValues; | 303 enumClass.enumValues = enumValues; |
| 304 } | 304 } |
| 305 } | 305 } |
| OLD | NEW |