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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 /// Concrete shadow object representing a named function expression. | 1350 /// Concrete shadow object representing a named function expression. |
1351 /// | 1351 /// |
1352 /// Named function expressions are not legal in Dart, but they are accepted by | 1352 /// Named function expressions are not legal in Dart, but they are accepted by |
1353 /// the parser and BodyBuilder for error recovery purposes. | 1353 /// the parser and BodyBuilder for error recovery purposes. |
1354 /// | 1354 /// |
1355 /// A named function expression of the form `f() { ... }` is represented as the | 1355 /// A named function expression of the form `f() { ... }` is represented as the |
1356 /// kernel expression: | 1356 /// kernel expression: |
1357 /// | 1357 /// |
1358 /// let f = () { ... } in f | 1358 /// let f = () { ... } in f |
1359 class KernelNamedFunctionExpression extends Let implements KernelExpression { | 1359 class KernelNamedFunctionExpression extends Let implements KernelExpression { |
1360 KernelNamedFunctionExpression(VariableDeclaration variable, Expression body) | 1360 KernelNamedFunctionExpression(VariableDeclaration variable) |
1361 : super(variable, body); | 1361 : super(variable, new VariableGet(variable)); |
1362 | 1362 |
1363 @override | 1363 @override |
1364 void _collectDependencies(KernelDependencyCollector collector) { | 1364 void _collectDependencies(KernelDependencyCollector collector) { |
1365 collector.collectDependencies(variable.initializer); | 1365 collector.collectDependencies(variable.initializer); |
1366 } | 1366 } |
1367 | 1367 |
1368 @override | 1368 @override |
1369 DartType _inferExpression( | 1369 DartType _inferExpression( |
1370 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 1370 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
1371 typeNeeded = | 1371 typeNeeded = |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2507 accept(v) => unsupported("accept", -1, null); | 2507 accept(v) => unsupported("accept", -1, null); |
2508 | 2508 |
2509 accept1(v, arg) => unsupported("accept1", -1, null); | 2509 accept1(v, arg) => unsupported("accept1", -1, null); |
2510 | 2510 |
2511 getStaticType(types) => unsupported("getStaticType", -1, null); | 2511 getStaticType(types) => unsupported("getStaticType", -1, null); |
2512 | 2512 |
2513 transformChildren(v) => unsupported("transformChildren", -1, null); | 2513 transformChildren(v) => unsupported("transformChildren", -1, null); |
2514 | 2514 |
2515 visitChildren(v) => unsupported("visitChildren", -1, null); | 2515 visitChildren(v) => unsupported("visitChildren", -1, null); |
2516 } | 2516 } |
OLD | NEW |