OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'dart:collection' show HashMap, HashSet; | 5 import 'dart:collection' show HashSet; |
6 import 'package:analyzer/dart/ast/ast.dart' show Identifier; | 6 import 'package:analyzer/dart/ast/ast.dart' show Identifier; |
7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
8 | 8 import 'extension_types.dart'; |
9 import 'js_codegen.dart' show ExtensionTypeSet; | |
10 | 9 |
11 /// We use a storage slot for fields that override or can be overridden by | 10 /// We use a storage slot for fields that override or can be overridden by |
12 /// getter/setter pairs. | 11 /// getter/setter pairs. |
13 HashSet<FieldElement> findFieldsNeedingStorage( | 12 HashSet<FieldElement> findFieldsNeedingStorage( |
14 Iterable<CompilationUnitElement> units, ExtensionTypeSet extensionTypes) { | 13 Iterable<CompilationUnitElement> units, ExtensionTypeSet extensionTypes) { |
15 var overrides = new HashSet<FieldElement>(); | 14 var overrides = new HashSet<FieldElement>(); |
16 for (var unit in units) { | 15 for (var unit in units) { |
17 for (var cls in unit.types) { | 16 for (var cls in unit.types) { |
18 var superclasses = getSuperclasses(cls); | 17 var superclasses = getSuperclasses(cls); |
19 for (var field in cls.fields) { | 18 for (var field in cls.fields) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if (mixin != null) result.add(mixin); | 81 if (mixin != null) result.add(mixin); |
83 } | 82 } |
84 var supertype = cls.supertype; | 83 var supertype = cls.supertype; |
85 if (supertype == null) break; | 84 if (supertype == null) break; |
86 | 85 |
87 cls = supertype.element; | 86 cls = supertype.element; |
88 result.add(cls); | 87 result.add(cls); |
89 } | 88 } |
90 return result; | 89 return result; |
91 } | 90 } |
OLD | NEW |