Chromium Code Reviews| Index: pkg/kernel/lib/ast.dart |
| diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart |
| index a27c198a9326d3d6d21fcbdd261217bed35c2d67..f60a34bb4cf3e904a1bb3ce47ebab7f6099a610d 100644 |
| --- a/pkg/kernel/lib/ast.dart |
| +++ b/pkg/kernel/lib/ast.dart |
| @@ -2855,6 +2855,38 @@ class VectorCopy extends Expression { |
| } |
| } |
| +/// Expression of the form `MakeClosure(f, c, t)` where `f` is a name of a |
| +/// closed top-level function, `c` is a Vector representing closure context, and |
| +/// `t` is the type of the resulting closure. |
| +class ClosureCreation extends Expression { |
| + String topLevelFunctionName; |
|
asgerf
2017/03/31 11:03:52
Again, please use a reference to the member
Dmitry Stefantsov
2017/03/31 11:54:13
Done.
|
| + Expression contextVector; |
| + FunctionType functionType; |
| + |
| + ClosureCreation( |
| + this.topLevelFunctionName, this.contextVector, this.functionType) { |
| + contextVector?.parent = this; |
| + } |
| + |
| + accept(ExpressionVisitor v) => v.visitClosureCreation(this); |
| + accept1(ExpressionVisitor1 v, arg) => v.visitClosureCreation(this, arg); |
| + |
| + visitChildren(Visitor v) { |
| + contextVector?.accept(v); |
| + } |
| + |
| + transformChildren(Transformer v) { |
| + if (contextVector != null) { |
| + contextVector = contextVector.accept(v); |
| + contextVector?.parent = this; |
| + } |
| + } |
| + |
| + DartType getStaticType(TypeEnvironment types) { |
| + return functionType; |
| + } |
| +} |
| + |
| // ------------------------------------------------------------------------ |
| // STATEMENTS |
| // ------------------------------------------------------------------------ |