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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1238783003: Handle deferred access as pre-step in SemanticSendVisitor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'elements.dart'; 8 import 'elements.dart';
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/constructors.dart'; 10 import '../constants/constructors.dart';
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 importScope.addImport(this, element, import, listener); 1113 importScope.addImport(this, element, import, listener);
1114 } 1114 }
1115 1115
1116 accept(ElementVisitor visitor, arg) { 1116 accept(ElementVisitor visitor, arg) {
1117 return visitor.visitPrefixElement(this, arg); 1117 return visitor.visitPrefixElement(this, arg);
1118 } 1118 }
1119 1119
1120 void markAsDeferred(Import deferredImport) { 1120 void markAsDeferred(Import deferredImport) {
1121 _deferredImport = deferredImport; 1121 _deferredImport = deferredImport;
1122 } 1122 }
1123
1124 String toString() => '$kind($name)';
1123 } 1125 }
1124 1126
1125 class TypedefElementX extends ElementX 1127 class TypedefElementX extends ElementX
1126 with AstElementMixin, 1128 with AstElementMixin,
1127 AnalyzableElementX, 1129 AnalyzableElementX,
1128 TypeDeclarationElementX<TypedefType> 1130 TypeDeclarationElementX<TypedefType>
1129 implements TypedefElement { 1131 implements TypedefElement {
1130 Typedef cachedNode; 1132 Typedef cachedNode;
1131 1133
1132 /** 1134 /**
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 message: "Constant has not been computed for $this.")); 1235 message: "Constant has not been computed for $this."));
1234 return constantCache; 1236 return constantCache;
1235 } 1237 }
1236 1238
1237 void set constant(ConstantExpression value) { 1239 void set constant(ConstantExpression value) {
1238 if (isPatch) { 1240 if (isPatch) {
1239 ConstantVariableMixin originVariable = origin; 1241 ConstantVariableMixin originVariable = origin;
1240 originVariable.constant = value; 1242 originVariable.constant = value;
1241 return null; 1243 return null;
1242 } 1244 }
1243 assert(invariant(this, constantCache == null || constantCache == value, 1245 assert(invariant(
1244 message: "Constant has already been computed for $this.")); 1246 this, constantCache == null || constantCache == value,
1247 message: "Constant has already been computed for $this. "
1248 "Existing constant: ${constantCache.getText()}, "
1249 "New constant: ${value != null ? value.getText() : ''}."));
1245 constantCache = value; 1250 constantCache = value;
1246 } 1251 }
1247 } 1252 }
1248 1253
1249 abstract class VariableElementX extends ElementX 1254 abstract class VariableElementX extends ElementX
1250 with AstElementMixin, ConstantVariableMixin 1255 with AstElementMixin, ConstantVariableMixin
1251 implements VariableElement { 1256 implements VariableElement {
1252 final Token token; 1257 final Token token;
1253 final VariableList variables; 1258 final VariableList variables;
1254 VariableDefinitions definitionsCache; 1259 VariableDefinitions definitionsCache;
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2892 AstElement get definingElement; 2897 AstElement get definingElement;
2893 2898
2894 bool get hasResolvedAst => definingElement.hasTreeElements; 2899 bool get hasResolvedAst => definingElement.hasTreeElements;
2895 2900
2896 ResolvedAst get resolvedAst { 2901 ResolvedAst get resolvedAst {
2897 return new ResolvedAst(declaration, 2902 return new ResolvedAst(declaration,
2898 definingElement.node, definingElement.treeElements); 2903 definingElement.node, definingElement.treeElements);
2899 } 2904 }
2900 2905
2901 } 2906 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698