Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1285)

Unified Diff: pkg/kernel/lib/transformations/closure/converter.dart

Issue 2767773004: Add Vector type to Kernel (Closed)
Patch Set: Add a note to return Run step in Closure Conversion test suite Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/kernel/lib/transformations/closure/converter.dart
diff --git a/pkg/kernel/lib/transformations/closure/converter.dart b/pkg/kernel/lib/transformations/closure/converter.dart
index a2a45e5c2e230a71771e93d1e6a036f57842f9b7..2b67d375a01320ba35f9e353896f7f5bf348064b 100644
--- a/pkg/kernel/lib/transformations/closure/converter.dart
+++ b/pkg/kernel/lib/transformations/closure/converter.dart
@@ -52,6 +52,7 @@ import '../../ast.dart'
VariableDeclaration,
VariableGet,
VariableSet,
+ VectorType,
transformList;
import '../../frontend/accessors.dart' show VariableAccessor;
@@ -263,7 +264,7 @@ class ClosureConverter extends Transformer {
VariableDeclaration contextVariable = new VariableDeclaration(
"#contextParameter",
- type: contextClass.rawType,
+ type: const VectorType(),
isFinal: true);
Context parent = context;
context = context.toNestedContext(new VariableAccessor(contextVariable));
@@ -314,13 +315,13 @@ class ClosureConverter extends Transformer {
/// Add a new class to the current library that looks like this:
///
/// class Closure#0 extends core::Object implements core::Function {
- /// field _in::Context context;
- /// constructor •(final _in::Context #t1) → dynamic
- /// : self::Closure 0::context = #t1
+ /// field Vector context;
+ /// constructor •(final Vector #t1) → dynamic
+ /// : self::Closure#0::context = #t1
/// ;
/// method call(/* The parameters of [function] */) → dynamic {
/// /// #t2 is [contextVariable].
- /// final _in::Context #t2 = this.{self::Closure#0::context};
+ /// final Vector #t2 = this.{self::Closure#0::context};
/// /* The body of [function]. */
/// }
/// }
@@ -339,7 +340,7 @@ class ClosureConverter extends Transformer {
Field contextField = new Field(
// TODO(ahe): Rename to #context.
new Name("context"),
- type: contextClass.rawType,
+ type: const VectorType(),
fileUri: currentFileUri);
Class closureClass = createClosureClass(function,
fields: [contextField], substitution: substitution);

Powered by Google App Engine
This is Rietveld 408576698