OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.kernel.env; | 5 library dart2js.kernel.env; |
6 | 6 |
7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
8 import 'package:kernel/clone.dart'; | 8 import 'package:kernel/clone.dart'; |
9 import 'package:kernel/type_algebra.dart'; | 9 import 'package:kernel/type_algebra.dart'; |
10 | 10 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 Map<String, ir.Member> _constructorMap; | 154 Map<String, ir.Member> _constructorMap; |
155 Map<String, ir.Member> _memberMap; | 155 Map<String, ir.Member> _memberMap; |
156 Map<String, ir.Member> _setterMap; | 156 Map<String, ir.Member> _setterMap; |
157 | 157 |
158 ClassEnv(this.cls) | 158 ClassEnv(this.cls) |
159 // TODO(johnniwinther): Change this to use a property on [cls] when such | 159 // TODO(johnniwinther): Change this to use a property on [cls] when such |
160 // is added to kernel. | 160 // is added to kernel. |
161 : isUnnamedMixinApplication = | 161 : isUnnamedMixinApplication = |
162 cls.name.contains('+') || cls.name.contains('&'); | 162 cls.name.contains('+') || cls.name.contains('&'); |
163 | 163 |
| 164 // TODO(efortuna): This is gross because even though the closure class *has* |
| 165 // members, we're not populating this because they aren't ir.Member types. :-( |
| 166 ClassEnv.closureClass() |
| 167 : cls = null, |
| 168 isUnnamedMixinApplication = false, |
| 169 _constructorMap = const <String, ir.Member>{}, |
| 170 _memberMap = const <String, ir.Member>{}, |
| 171 _setterMap = const <String, ir.Member>{}; |
| 172 |
164 /// Copied from 'package:kernel/transformations/mixin_full_resolution.dart'. | 173 /// Copied from 'package:kernel/transformations/mixin_full_resolution.dart'. |
165 ir.Constructor _buildForwardingConstructor( | 174 ir.Constructor _buildForwardingConstructor( |
166 CloneVisitor cloner, ir.Constructor superclassConstructor) { | 175 CloneVisitor cloner, ir.Constructor superclassConstructor) { |
167 var superFunction = superclassConstructor.function; | 176 var superFunction = superclassConstructor.function; |
168 | 177 |
169 // We keep types and default values for the parameters but always mark the | 178 // We keep types and default values for the parameters but always mark the |
170 // parameters as final (since we just forward them to the super | 179 // parameters as final (since we just forward them to the super |
171 // constructor). | 180 // constructor). |
172 ir.VariableDeclaration cloneVariable(ir.VariableDeclaration variable) { | 181 ir.VariableDeclaration cloneVariable(ir.VariableDeclaration variable) { |
173 ir.VariableDeclaration clone = cloner.clone(variable); | 182 ir.VariableDeclaration clone = cloner.clone(variable); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 439 } |
431 } | 440 } |
432 return _constant; | 441 return _constant; |
433 } | 442 } |
434 | 443 |
435 @override | 444 @override |
436 FieldData copy() { | 445 FieldData copy() { |
437 return new FieldData(node); | 446 return new FieldData(node); |
438 } | 447 } |
439 } | 448 } |
OLD | NEW |