OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 /// This file declares a "shadow hierarchy" of concrete classes which extend | 5 /// This file declares a "shadow hierarchy" of concrete classes which extend |
6 /// the kernel class hierarchy, adding methods and fields needed by the | 6 /// the kernel class hierarchy, adding methods and fields needed by the |
7 /// BodyBuilder. | 7 /// BodyBuilder. |
8 /// | 8 /// |
9 /// Instances of these classes may be created using the factory methods in | 9 /// Instances of these classes may be created using the factory methods in |
10 /// `ast_factory.dart`. | 10 /// `ast_factory.dart`. |
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 // Hack to deal with the fact that BodyBuilder still creates raw | 2127 // Hack to deal with the fact that BodyBuilder still creates raw |
2128 // VariableDeclaration objects sometimes. | 2128 // VariableDeclaration objects sometimes. |
2129 // TODO(paulberry): get rid of this once the type parameter is | 2129 // TODO(paulberry): get rid of this once the type parameter is |
2130 // KernelVariableDeclaration. | 2130 // KernelVariableDeclaration. |
2131 return 0; | 2131 return 0; |
2132 } | 2132 } |
2133 } | 2133 } |
2134 | 2134 |
2135 @override | 2135 @override |
2136 bool isPromotionCandidate(VariableDeclaration variable) { | 2136 bool isPromotionCandidate(VariableDeclaration variable) { |
2137 if (variable is KernelVariableDeclaration) { | 2137 assert(variable is KernelVariableDeclaration); |
2138 return !variable._isLocalFunction; | 2138 KernelVariableDeclaration kernelVariableDeclaration = variable; |
2139 } else { | 2139 return !kernelVariableDeclaration._isLocalFunction; |
2140 // Hack to deal with the fact that BodyBuilder still creates raw | |
2141 // VariableDeclaration objects sometimes. | |
2142 // TODO(paulberry): get rid of this once the type parameter is | |
2143 // KernelVariableDeclaration. | |
2144 return true; | |
2145 } | |
2146 } | 2140 } |
2147 | 2141 |
2148 @override | 2142 @override |
2149 bool sameExpressions(Expression a, Expression b) { | 2143 bool sameExpressions(Expression a, Expression b) { |
2150 return identical(a, b); | 2144 return identical(a, b); |
2151 } | 2145 } |
2152 | 2146 |
2153 @override | 2147 @override |
2154 void setVariableMutatedAnywhere(VariableDeclaration variable) { | 2148 void setVariableMutatedAnywhere(VariableDeclaration variable) { |
2155 if (variable is KernelVariableDeclaration) { | 2149 if (variable is KernelVariableDeclaration) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 } | 2355 } |
2362 | 2356 |
2363 transformChildren(v) { | 2357 transformChildren(v) { |
2364 return internalError("Internal error: Unsupported operation."); | 2358 return internalError("Internal error: Unsupported operation."); |
2365 } | 2359 } |
2366 | 2360 |
2367 visitChildren(v) { | 2361 visitChildren(v) { |
2368 return internalError("Internal error: Unsupported operation."); | 2362 return internalError("Internal error: Unsupported operation."); |
2369 } | 2363 } |
2370 } | 2364 } |
OLD | NEW |