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

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

Issue 2898403002: Use failedAt in more places (Closed)
Patch Set: merge; address comments Created 3 years, 6 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 | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/enqueue.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) 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/names.dart' show Identifiers; 8 import '../common/names.dart' show Identifiers;
9 import '../common/resolution.dart' show Resolution, ParsingContext; 9 import '../common/resolution.dart' show Resolution, ParsingContext;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 1552 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 SendSet sendSet = initializedIdentifier.asSendSet(); 1563 SendSet sendSet = initializedIdentifier.asSendSet();
1564 identifier = sendSet.selector.asIdentifier(); 1564 identifier = sendSet.selector.asIdentifier();
1565 if (identical(name, identifier.source)) { 1565 if (identical(name, identifier.source)) {
1566 definitionCache = initializedIdentifier; 1566 definitionCache = initializedIdentifier;
1567 initializerCache = sendSet.arguments.first; 1567 initializerCache = sendSet.arguments.first;
1568 } 1568 }
1569 } else if (identical(name, identifier.source)) { 1569 } else if (identical(name, identifier.source)) {
1570 definitionCache = initializedIdentifier; 1570 definitionCache = initializedIdentifier;
1571 } 1571 }
1572 } 1572 }
1573 invariant(definitions, definitionCache != null, 1573 if (definitionCache == null) {
1574 message: "Could not find '$name'."); 1574 failedAt(definitionCache, "Could not find '$name'.");
1575 }
1575 definitionsCache = definitions; 1576 definitionsCache = definitions;
1576 } 1577 }
1577 1578
1578 ResolutionDartType computeType(Resolution resolution) { 1579 ResolutionDartType computeType(Resolution resolution) {
1579 if (variables.type != null) return variables.type; 1580 if (variables.type != null) return variables.type;
1580 // Call [parseNode] to ensure that [definitionsCache] and [initializerCache] 1581 // Call [parseNode] to ensure that [definitionsCache] and [initializerCache]
1581 // are set as a consequence of calling [computeType]. 1582 // are set as a consequence of calling [computeType].
1582 parseNode(resolution.parsingContext); 1583 parseNode(resolution.parsingContext);
1583 return variables.computeType(this, resolution); 1584 return variables.computeType(this, resolution);
1584 } 1585 }
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after
3512 body = node.asFunctionExpression().body; 3513 body = node.asFunctionExpression().body;
3513 } 3514 }
3514 return new ParsedResolvedAst( 3515 return new ParsedResolvedAst(
3515 declaration, 3516 declaration,
3516 node, 3517 node,
3517 body, 3518 body,
3518 definingElement.treeElements, 3519 definingElement.treeElements,
3519 definingElement.compilationUnit.script.resourceUri); 3520 definingElement.compilationUnit.script.resourceUri);
3520 } 3521 }
3521 } 3522 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698