| OLD | NEW |
| 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 get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 1883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 initializerDo(parameterNode, (n) => n.accept(this)); | 1894 initializerDo(parameterNode, (n) => n.accept(this)); |
| 1895 // Field parameters (this.x) are not visible inside the constructor. The | 1895 // Field parameters (this.x) are not visible inside the constructor. The |
| 1896 // fields they reference are visible, but must be resolved independently. | 1896 // fields they reference are visible, but must be resolved independently. |
| 1897 if (element.kind == ElementKind.FIELD_PARAMETER) { | 1897 if (element.kind == ElementKind.FIELD_PARAMETER) { |
| 1898 useElement(parameterNode, element); | 1898 useElement(parameterNode, element); |
| 1899 } else { | 1899 } else { |
| 1900 defineElement(variableDefinitions.definitions.nodes.head, element); | 1900 defineElement(variableDefinitions.definitions.nodes.head, element); |
| 1901 } | 1901 } |
| 1902 parameterNodes = parameterNodes.tail; | 1902 parameterNodes = parameterNodes.tail; |
| 1903 }); | 1903 }); |
| 1904 if (inCheckContext) { | |
| 1905 functionParameters.forEachParameter((Element element) { | |
| 1906 compiler.enqueuer.resolution.registerIsCheck( | |
| 1907 element.computeType(compiler), mapping); | |
| 1908 }); | |
| 1909 } | |
| 1910 } | 1904 } |
| 1911 | 1905 |
| 1912 visitCascade(Cascade node) { | 1906 visitCascade(Cascade node) { |
| 1913 visit(node.expression); | 1907 visit(node.expression); |
| 1914 } | 1908 } |
| 1915 | 1909 |
| 1916 visitCascadeReceiver(CascadeReceiver node) { | 1910 visitCascadeReceiver(CascadeReceiver node) { |
| 1917 visit(node.expression); | 1911 visit(node.expression); |
| 1918 } | 1912 } |
| 1919 | 1913 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1997 enclosingElement = function; | 1991 enclosingElement = function; |
| 1998 // Run the body in a fresh statement scope. | 1992 // Run the body in a fresh statement scope. |
| 1999 StatementScope oldStatementScope = statementScope; | 1993 StatementScope oldStatementScope = statementScope; |
| 2000 statementScope = new StatementScope(); | 1994 statementScope = new StatementScope(); |
| 2001 visit(node.body); | 1995 visit(node.body); |
| 2002 statementScope = oldStatementScope; | 1996 statementScope = oldStatementScope; |
| 2003 | 1997 |
| 2004 scope = oldScope; | 1998 scope = oldScope; |
| 2005 enclosingElement = previousEnclosingElement; | 1999 enclosingElement = previousEnclosingElement; |
| 2006 | 2000 |
| 2007 world.registerClosurizedMember(function, mapping); | |
| 2008 world.registerInstantiatedClass(compiler.functionClass, mapping); | 2001 world.registerInstantiatedClass(compiler.functionClass, mapping); |
| 2009 } | 2002 } |
| 2010 | 2003 |
| 2011 visitIf(If node) { | 2004 visitIf(If node) { |
| 2012 visit(node.condition); | 2005 visit(node.condition); |
| 2013 visitIn(node.thenPart, new BlockScope(scope)); | 2006 visitIn(node.thenPart, new BlockScope(scope)); |
| 2014 visitIn(node.elsePart, new BlockScope(scope)); | 2007 visitIn(node.elsePart, new BlockScope(scope)); |
| 2015 } | 2008 } |
| 2016 | 2009 |
| 2017 static bool isLogicalOperator(Identifier op) { | 2010 static bool isLogicalOperator(Identifier op) { |
| (...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4054 return e; | 4047 return e; |
| 4055 } | 4048 } |
| 4056 | 4049 |
| 4057 /// Assumed to be called by [resolveRedirectingFactory]. | 4050 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4058 Element visitReturn(Return node) { | 4051 Element visitReturn(Return node) { |
| 4059 Node expression = node.expression; | 4052 Node expression = node.expression; |
| 4060 return finishConstructorReference(visit(expression), | 4053 return finishConstructorReference(visit(expression), |
| 4061 expression, expression); | 4054 expression, expression); |
| 4062 } | 4055 } |
| 4063 } | 4056 } |
| OLD | NEW |