Chromium Code Reviews| Index: pkg/analyzer2dart/lib/src/cps_generator.dart |
| diff --git a/pkg/analyzer2dart/lib/src/cps_generator.dart b/pkg/analyzer2dart/lib/src/cps_generator.dart |
| index 7efa4230461449f143e5dbec2adc3d6d24876d7f..0bb9520e86f474f9bbb43c1fdfe119e59de12a87 100644 |
| --- a/pkg/analyzer2dart/lib/src/cps_generator.dart |
| +++ b/pkg/analyzer2dart/lib/src/cps_generator.dart |
| @@ -65,11 +65,12 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node> |
| analyzer.PropertyInducingElement field, VariableDeclaration node) { |
| dart2js.FieldElement element = converter.convertElement(field); |
| return withBuilder( |
| - new IrBuilder(DART_CONSTANT_SYSTEM, |
| + new DartIrBuilder(DART_CONSTANT_SYSTEM, |
| element, |
|
Kevin Millikin (Google)
2015/01/13 08:25:36
The arguments were aligned before, now they're off
asgerf
2015/01/13 10:04:26
Thanks
|
| // TODO(johnniwinther): Supported closure variables. |
| - const <dart2js.Local>[]), |
| + new NullClosureVariableInfo()), |
| () { |
| + irBuilder.beginField(); |
| ir.Primitive initializer = build(node.initializer); |
| return irBuilder.makeFieldDefinition(initializer); |
| }); |
| @@ -79,16 +80,13 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node> |
| analyzer.FunctionElement function, FunctionExpression node) { |
| dart2js.FunctionElement element = converter.convertElement(function); |
| return withBuilder( |
| - new IrBuilder(DART_CONSTANT_SYSTEM, |
| + new DartIrBuilder(DART_CONSTANT_SYSTEM, |
| element, |
|
Kevin Millikin (Google)
2015/01/13 08:25:36
Same: 4-space indent.
|
| // TODO(johnniwinther): Supported closure variables. |
| - const <dart2js.Local>[]), |
| + new NullClosureVariableInfo()), |
| () { |
| - function.parameters.forEach((analyzer.ParameterElement parameter) { |
| - // TODO(johnniwinther): Support "closure variables", that is variables |
| - // accessed from an inner function. |
| - irBuilder.createFunctionParameter(converter.convertElement(parameter)); |
| - }); |
| + irBuilder.beginFunction( |
| + function.parameters.map(converter.convertElement)); |
| // Visit the body directly to avoid processing the signature as |
| // expressions. |
| visit(node.body); |
| @@ -521,3 +519,7 @@ class CpsGeneratingVisitor extends SemanticVisitor<ir.Node> |
| isTypeTest: false); |
| } |
| } |
| + |
| +class NullClosureVariableInfo extends ClosureVariableInfo { |
| + Iterable get capturedVariables => const []; |
| +} |