Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: pkg/dev_compiler/lib/src/compiler/js_field_storage.dart

Issue 2441693003: fix #27643, failed to virtualize fields if an abstract one is mixed in (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/dev_compiler/test/codegen/language/mixin_abstract_getter_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 HashSet; 5 import 'dart:collection' show HashSet;
6 6
7 import 'package:analyzer/dart/ast/ast.dart' show Identifier; 7 import 'package:analyzer/dart/ast/ast.dart' show Identifier;
8 import 'package:analyzer/dart/element/element.dart'; 8 import 'package:analyzer/dart/element/element.dart';
9 9
10 class PropertyOverrideResult { 10 class PropertyOverrideResult {
(...skipping 12 matching lines...) Expand all
23 var superprop = getProperty(superclass, field.library, field.name); 23 var superprop = getProperty(superclass, field.library, field.name);
24 if (superprop == null) continue; 24 if (superprop == null) continue;
25 25
26 var getter = superprop.getter; 26 var getter = superprop.getter;
27 bool hasGetter = getter != null && !getter.isAbstract; 27 bool hasGetter = getter != null && !getter.isAbstract;
28 if (hasGetter) foundGetter = true; 28 if (hasGetter) foundGetter = true;
29 29
30 var setter = superprop.setter; 30 var setter = superprop.setter;
31 bool hasSetter = setter != null && !setter.isAbstract; 31 bool hasSetter = setter != null && !setter.isAbstract;
32 if (hasSetter) foundSetter = true; 32 if (hasSetter) foundSetter = true;
33
34 // Stop if this is an abstract getter/setter
35 // TODO(jmesserly): why were we doing this?
36 if (!hasGetter && !hasSetter) break;
37 } 33 }
38 34
39 return new PropertyOverrideResult(foundGetter, foundSetter); 35 return new PropertyOverrideResult(foundGetter, foundSetter);
40 } 36 }
41 37
42 FieldElement getProperty( 38 FieldElement getProperty(
43 ClassElement cls, LibraryElement fromLibrary, String name) { 39 ClassElement cls, LibraryElement fromLibrary, String name) {
44 // Properties from a different library are not accessible. 40 // Properties from a different library are not accessible.
45 if (Identifier.isPrivateName(name) && cls.library != fromLibrary) { 41 if (Identifier.isPrivateName(name) && cls.library != fromLibrary) {
46 return null; 42 return null;
(...skipping 14 matching lines...) Expand all
61 if (mixin != null) result.add(mixin); 57 if (mixin != null) result.add(mixin);
62 } 58 }
63 var supertype = cls.supertype; 59 var supertype = cls.supertype;
64 if (supertype == null) break; 60 if (supertype == null) break;
65 61
66 cls = supertype.element; 62 cls = supertype.element;
67 result.add(cls); 63 result.add(cls);
68 } 64 }
69 return result; 65 return result;
70 } 66 }
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/test/codegen/language/mixin_abstract_getter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698