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 part of world_builder; | 5 part of world_builder; |
6 | 6 |
7 abstract class _AbstractUsage<T> { | 7 abstract class _AbstractUsage<T> { |
8 final EnumSet<T> _pendingUse = new EnumSet<T>(); | 8 final EnumSet<T> _pendingUse = new EnumSet<T>(); |
9 | 9 |
10 _AbstractUsage() { | 10 _AbstractUsage() { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
251 | 251 |
252 @override | 252 @override |
253 bool get fullyUsed => hasWrite; | 253 bool get fullyUsed => hasWrite; |
254 | 254 |
255 @override | 255 @override |
256 EnumSet<MemberUse> write() { | 256 EnumSet<MemberUse> write() { |
257 if (hasWrite) { | 257 if (hasWrite) { |
258 return MemberUses.NONE; | 258 return MemberUses.NONE; |
259 } | 259 } |
260 hasWrite = true; | 260 hasWrite = true; |
261 return MemberUses.NORMAL_ONLY; | 261 return _pendingUse.removeAll(MemberUses.NORMAL_ONLY); |
Johnni Winther
2017/03/13 11:24:10
A fix from another CL.
| |
262 } | 262 } |
263 | 263 |
264 @override | 264 @override |
265 EnumSet<MemberUse> fullyUse() => write(); | 265 EnumSet<MemberUse> fullyUse() => write(); |
266 } | 266 } |
267 | 267 |
268 /// Enum class for the possible kind of use of [MemberEntity] objects. | 268 /// Enum class for the possible kind of use of [MemberEntity] objects. |
269 enum MemberUse { NORMAL, CLOSURIZE_INSTANCE, CLOSURIZE_STATIC } | 269 enum MemberUse { NORMAL, CLOSURIZE_INSTANCE, CLOSURIZE_STATIC } |
270 | 270 |
271 /// Common [EnumSet]s used for [MemberUse]. | 271 /// Common [EnumSet]s used for [MemberUse]. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 if (hasClosurization) { | 372 if (hasClosurization) { |
373 return MemberUses.NONE; | 373 return MemberUses.NONE; |
374 } | 374 } |
375 hasNormalUse = hasClosurization = true; | 375 hasNormalUse = hasClosurization = true; |
376 return _pendingUse.removeAll(MemberUses.ALL_STATIC); | 376 return _pendingUse.removeAll(MemberUses.ALL_STATIC); |
377 } | 377 } |
378 | 378 |
379 @override | 379 @override |
380 EnumSet<MemberUse> get _originalUse => MemberUses.ALL_STATIC; | 380 EnumSet<MemberUse> get _originalUse => MemberUses.ALL_STATIC; |
381 } | 381 } |
OLD | NEW |