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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 2199903002: Create synthetic FieldElement(s) (don't use non-synthetic ones) for non-synthetic class getters/set… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 3125 matching lines...) Expand 10 before | Expand all | Expand 10 after
3136 _typeAliases.add(element); 3136 _typeAliases.add(element);
3137 } 3137 }
3138 3138
3139 void addTypeParameter(TypeParameterElement element) { 3139 void addTypeParameter(TypeParameterElement element) {
3140 if (_typeParameters == null) { 3140 if (_typeParameters == null) {
3141 _typeParameters = new List<TypeParameterElement>(); 3141 _typeParameters = new List<TypeParameterElement>();
3142 } 3142 }
3143 _typeParameters.add(element); 3143 _typeParameters.add(element);
3144 } 3144 }
3145 3145
3146 FieldElement getField(String fieldName) { 3146 FieldElement getField(String fieldName, {bool synthetic: false}) {
3147 if (_fields == null) { 3147 if (_fields == null) {
3148 return null; 3148 return null;
3149 } 3149 }
3150 int length = _fields.length; 3150 int length = _fields.length;
3151 for (int i = 0; i < length; i++) { 3151 for (int i = 0; i < length; i++) {
3152 FieldElement field = _fields[i]; 3152 FieldElement field = _fields[i];
3153 if (field.name == fieldName) { 3153 if (field.name == fieldName && field.isSynthetic == synthetic) {
3154 return field; 3154 return field;
3155 } 3155 }
3156 } 3156 }
3157 return null; 3157 return null;
3158 } 3158 }
3159 3159
3160 TopLevelVariableElement getTopLevelVariable(String variableName) { 3160 TopLevelVariableElement getTopLevelVariable(String variableName) {
3161 if (_topLevelVariables == null) { 3161 if (_topLevelVariables == null) {
3162 return null; 3162 return null;
3163 } 3163 }
(...skipping 7827 matching lines...) Expand 10 before | Expand all | Expand 10 after
10991 return null; 10991 return null;
10992 } 10992 }
10993 if (identical(node.staticElement, variable)) { 10993 if (identical(node.staticElement, variable)) {
10994 if (node.inSetterContext()) { 10994 if (node.inSetterContext()) {
10995 result = true; 10995 result = true;
10996 } 10996 }
10997 } 10997 }
10998 return null; 10998 return null;
10999 } 10999 }
11000 } 11000 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/builder.dart ('k') | pkg/analyzer/lib/src/task/incremental_element_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698