Chromium Code Reviews| 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 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1956 enclosingElement = function; | 1956 enclosingElement = function; |
| 1957 // Run the body in a fresh statement scope. | 1957 // Run the body in a fresh statement scope. |
| 1958 StatementScope oldStatementScope = statementScope; | 1958 StatementScope oldStatementScope = statementScope; |
| 1959 statementScope = new StatementScope(); | 1959 statementScope = new StatementScope(); |
| 1960 visit(node.body); | 1960 visit(node.body); |
| 1961 statementScope = oldStatementScope; | 1961 statementScope = oldStatementScope; |
| 1962 | 1962 |
| 1963 scope = oldScope; | 1963 scope = oldScope; |
| 1964 enclosingElement = previousEnclosingElement; | 1964 enclosingElement = previousEnclosingElement; |
| 1965 | 1965 |
| 1966 ClassElement thisClass = enclosingElement.getEnclosingClass(); | |
|
ngeoffray
2013/03/13 09:30:46
Please add a comment.
Johnni Winther
2013/03/22 07:30:24
Changed to use the type of [function] itself, thus
| |
| 1967 if (thisClass != null && !thisClass.typeVariables.isEmpty) { | |
| 1968 world.registerGenericClosure(function, mapping); | |
| 1969 } | |
| 1966 world.registerInstantiatedClass(compiler.functionClass, mapping); | 1970 world.registerInstantiatedClass(compiler.functionClass, mapping); |
| 1967 } | 1971 } |
| 1968 | 1972 |
| 1969 visitIf(If node) { | 1973 visitIf(If node) { |
| 1970 visit(node.condition); | 1974 visit(node.condition); |
| 1971 visit(node.thenPart); | 1975 visit(node.thenPart); |
| 1972 visit(node.elsePart); | 1976 visit(node.elsePart); |
| 1973 } | 1977 } |
| 1974 | 1978 |
| 1975 static bool isLogicalOperator(Identifier op) { | 1979 static bool isLogicalOperator(Identifier op) { |
| (...skipping 1879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3855 return e; | 3859 return e; |
| 3856 } | 3860 } |
| 3857 | 3861 |
| 3858 /// Assumed to be called by [resolveRedirectingFactory]. | 3862 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3859 Element visitReturn(Return node) { | 3863 Element visitReturn(Return node) { |
| 3860 Node expression = node.expression; | 3864 Node expression = node.expression; |
| 3861 return finishConstructorReference(visit(expression), | 3865 return finishConstructorReference(visit(expression), |
| 3862 expression, expression); | 3866 expression, expression); |
| 3863 } | 3867 } |
| 3864 } | 3868 } |
| OLD | NEW |