Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.kernel_enum_builder; | 5 library fasta.kernel_enum_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' show | 7 import 'package:kernel/ast.dart' show |
| 8 Arguments, | 8 Arguments, |
| 9 AsyncMarker, | 9 AsyncMarker, |
| 10 Class, | 10 Class, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 new KernelFieldBuilder(null, selfType, name, constMask | staticMask); | 129 new KernelFieldBuilder(null, selfType, name, constMask | staticMask); |
| 130 members[name] = fieldBuilder; | 130 members[name] = fieldBuilder; |
| 131 toStringEntries.add(new MapEntry( | 131 toStringEntries.add(new MapEntry( |
| 132 new IntLiteral(index), new StringLiteral("$className.$name"))); | 132 new IntLiteral(index), new StringLiteral("$className.$name"))); |
| 133 index++; | 133 index++; |
| 134 } | 134 } |
| 135 MapLiteral toStringMap = new MapLiteral(toStringEntries, isConst: true); | 135 MapLiteral toStringMap = new MapLiteral(toStringEntries, isConst: true); |
| 136 KernelEnumBuilder enumBuilder = new KernelEnumBuilder.internal(metadata, | 136 KernelEnumBuilder enumBuilder = new KernelEnumBuilder.internal(metadata, |
| 137 name, members, types, cls, constants, toStringMap, intType, stringType, | 137 name, members, types, cls, constants, toStringMap, intType, stringType, |
| 138 parent); | 138 parent); |
| 139 members.forEach((String name, MemberBuilder builder) { | 139 members.forEach((String name, Builder builder) { |
|
Siggi Cherem (dart-lang)
2017/02/02 04:26:58
it would be nice to be able to use `covariant` in
ahe
2017/02/02 07:28:30
Please don't change explicit types.
Siggi Cherem (dart-lang)
2017/02/06 23:35:50
OK - I switched it to dynamic (I believe this is w
| |
| 140 builder.parent = enumBuilder; | 140 MemberBuilder memberBuilder = builder; |
| 141 memberBuilder.parent = enumBuilder; | |
| 141 }); | 142 }); |
| 142 selfType.builder = enumBuilder; | 143 selfType.builder = enumBuilder; |
| 143 return enumBuilder; | 144 return enumBuilder; |
| 144 } | 145 } |
| 145 | 146 |
| 146 InterfaceType buildType(List<KernelTypeBuilder> arguments) { | 147 InterfaceType buildType(List<KernelTypeBuilder> arguments) { |
| 147 return cls.rawType; | 148 return cls.rawType; |
| 148 } | 149 } |
| 149 | 150 |
| 150 Class build(KernelLibraryBuilder libraryBuilder) { | 151 Class build(KernelLibraryBuilder libraryBuilder) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 182 Arguments arguments = | 183 Arguments arguments = |
| 183 new Arguments(<Expression>[new IntLiteral(index++)]); | 184 new Arguments(<Expression>[new IntLiteral(index++)]); |
| 184 field.initializer = | 185 field.initializer = |
| 185 new ConstructorInvocation(constructor, arguments, isConst: true); | 186 new ConstructorInvocation(constructor, arguments, isConst: true); |
| 186 } | 187 } |
| 187 return super.build(libraryBuilder); | 188 return super.build(libraryBuilder); |
| 188 } | 189 } |
| 189 | 190 |
| 190 Builder findConstructorOrFactory(String name) => null; | 191 Builder findConstructorOrFactory(String name) => null; |
| 191 } | 192 } |
| OLD | NEW |