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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12393004: Check if enclosingElement is null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 Selector getGetterSelectorInComplexSendSet(SendSet node); 10 Selector getGetterSelectorInComplexSendSet(SendSet node);
(...skipping 1619 matching lines...) Expand 10 before | Expand all | Expand 10 after
1630 // When the element is a field, we are actually resolving its 1630 // When the element is a field, we are actually resolving its
1631 // initial value, which should not have access to instance 1631 // initial value, which should not have access to instance
1632 // fields. 1632 // fields.
1633 inInstanceContext = (element.isInstanceMember() && !element.isField()) 1633 inInstanceContext = (element.isInstanceMember() && !element.isField())
1634 || element.isGenerativeConstructor(), 1634 || element.isGenerativeConstructor(),
1635 this.currentClass = element.isMember() ? element.getEnclosingClass() 1635 this.currentClass = element.isMember() ? element.getEnclosingClass()
1636 : null, 1636 : null,
1637 this.statementScope = new StatementScope(), 1637 this.statementScope = new StatementScope(),
1638 typeResolver = new TypeResolver(compiler), 1638 typeResolver = new TypeResolver(compiler),
1639 scope = element.buildScope(), 1639 scope = element.buildScope(),
1640 inCheckContext = compiler.enableTypeAssertions && 1640 inCheckContext = compiler.enableTypeAssertions &&
ngeoffray 2013/03/01 09:49:18 Comment?
karlklose 2013/03/01 10:21:44 Created a CL.
1641 !element.enclosingElement.isTypedef(), 1641 (element.enclosingElement == null ||
1642 !element.enclosingElement.isTypedef()),
ngeoffray 2013/03/01 09:49:18 So we're creating a ResolverVisitor for things con
ahe 2013/03/01 09:54:36 I'm also confused about this. This fix does not lo
karlklose 2013/03/01 10:21:44 When the signature resolver asks the VariableListE
ahe 2013/03/12 08:15:40 That does not explain why you have an element that
1642 inCatchBlock = false, 1643 inCatchBlock = false,
1643 super(compiler); 1644 super(compiler);
1644 1645
1645 ResolutionEnqueuer get world => compiler.enqueuer.resolution; 1646 ResolutionEnqueuer get world => compiler.enqueuer.resolution;
1646 1647
1647 Element lookup(Node node, SourceString name) { 1648 Element lookup(Node node, SourceString name) {
1648 Element result = scope.lookup(name); 1649 Element result = scope.lookup(name);
1649 if (!Elements.isUnresolved(result)) { 1650 if (!Elements.isUnresolved(result)) {
1650 if (!inInstanceContext && result.isInstanceMember()) { 1651 if (!inInstanceContext && result.isInstanceMember()) {
1651 compiler.reportErrorCode( 1652 compiler.reportErrorCode(
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
3799 return e; 3800 return e;
3800 } 3801 }
3801 3802
3802 /// Assumed to be called by [resolveRedirectingFactory]. 3803 /// Assumed to be called by [resolveRedirectingFactory].
3803 Element visitReturn(Return node) { 3804 Element visitReturn(Return node) {
3804 Node expression = node.expression; 3805 Node expression = node.expression;
3805 return finishConstructorReference(visit(expression), 3806 return finishConstructorReference(visit(expression),
3806 expression, expression); 3807 expression, expression);
3807 } 3808 }
3808 } 3809 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698