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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 150693005: Fix ParameterMirror.hasDefaultValue/defaultValue in source mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix handling of external parameters Created 6 years, 10 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 | Annotate | Revision Log
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 'elements.dart'; 7 import 'elements.dart';
8 import '../../compiler.dart' as api; 8 import '../../compiler.dart' as api;
9 import '../tree/tree.dart'; 9 import '../tree/tree.dart';
10 import '../util/util.dart'; 10 import '../util/util.dart';
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 return variables.computeType(compiler); 1162 return variables.computeType(compiler);
1163 } 1163 }
1164 1164
1165 bool isInstanceMember() => variables.isInstanceMember(); 1165 bool isInstanceMember() => variables.isInstanceMember();
1166 1166
1167 // Note: cachedNode.getBeginToken() will not be correct in all 1167 // Note: cachedNode.getBeginToken() will not be correct in all
1168 // cases, for example, for function typed parameters. 1168 // cases, for example, for function typed parameters.
1169 Token position() => findMyName(variables.position()); 1169 Token position() => findMyName(variables.position());
1170 1170
1171 accept(ElementVisitor visitor) => visitor.visitVariableElement(this); 1171 accept(ElementVisitor visitor) => visitor.visitVariableElement(this);
1172
1173 // TODO(johnniwinther): Move the patch/origin implementation to a parameter
1174 // specific element when added.
1175
1176 /**
1177 * A function declaration that should be parsed instead of the current one.
1178 * The patch should be parsed as if it was in the current scope. Its
1179 * signature must match this function's signature.
1180 */
1181 VariableElementX patch = null;
1182 VariableElementX origin = null;
1183
1184 bool get isPatch => origin != null;
1185 bool get isPatched => patch != null;
1172 } 1186 }
1173 1187
1174 class FieldElementX extends VariableElementX implements FieldElement { 1188 class FieldElementX extends VariableElementX implements FieldElement {
1175 List<FunctionElement> nestedClosures = new List<FunctionElement>(); 1189 List<FunctionElement> nestedClosures = new List<FunctionElement>();
1176 1190
1177 FieldElementX(String name, 1191 FieldElementX(String name,
1178 VariableListElement variables, 1192 VariableListElement variables,
1179 Expression cachedNode) 1193 Expression cachedNode)
1180 : super(name, variables, ElementKind.FIELD, cachedNode); 1194 : super(name, variables, ElementKind.FIELD, cachedNode);
1181 1195
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 2488
2475 MetadataAnnotation ensureResolved(Compiler compiler) { 2489 MetadataAnnotation ensureResolved(Compiler compiler) {
2476 if (resolutionState == STATE_NOT_STARTED) { 2490 if (resolutionState == STATE_NOT_STARTED) {
2477 compiler.resolver.resolveMetadataAnnotation(this); 2491 compiler.resolver.resolveMetadataAnnotation(this);
2478 } 2492 }
2479 return this; 2493 return this;
2480 } 2494 }
2481 2495
2482 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2496 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2483 } 2497 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698