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

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

Issue 1892093003: Support deserialized compilation of the empty program. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments Created 4 years, 8 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 '../common/resolution.dart' show Resolution, Parsing; 8 import '../common/resolution.dart' show Resolution, Parsing;
9 import '../compiler.dart' show Compiler; 9 import '../compiler.dart' show Compiler;
10 import '../constants/constant_constructors.dart'; 10 import '../constants/constant_constructors.dart';
(...skipping 3250 matching lines...) Expand 10 before | Expand all | Expand 10 after
3261 /// found through [declaration] since its node define the inheritance relation 3261 /// found through [declaration] since its node define the inheritance relation
3262 /// for the class. For unpatched elements the defining element is the element 3262 /// for the class. For unpatched elements the defining element is the element
3263 /// itself. 3263 /// itself.
3264 AstElement get definingElement; 3264 AstElement get definingElement;
3265 3265
3266 bool get hasResolvedAst { 3266 bool get hasResolvedAst {
3267 return definingElement.hasNode && definingElement.hasTreeElements; 3267 return definingElement.hasNode && definingElement.hasTreeElements;
3268 } 3268 }
3269 3269
3270 ResolvedAst get resolvedAst { 3270 ResolvedAst get resolvedAst {
3271 Node node = definingElement.node;
3272 Node body;
3273 if (definingElement.isField) {
3274 FieldElement field = definingElement;
3275 body = field.initializer;
3276 } else if (node != null && node.asFunctionExpression() != null) {
3277 body = node.asFunctionExpression().body;
3278 }
3271 return new ParsedResolvedAst( 3279 return new ParsedResolvedAst(
3272 declaration, definingElement.node, definingElement.treeElements); 3280 declaration, node, body, definingElement.treeElements);
3273 } 3281 }
3274 } 3282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698