| Index: pkg/compiler/lib/src/kernel/element_map_impl.dart
|
| diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
|
| index 380853e75be6af85dcb108df56dc3effc7e535f7..221d27c9c82b5c249b982743bd074955158a78ee 100644
|
| --- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
|
| +++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
|
| @@ -6,7 +6,7 @@ library dart2js.kernel.element_map;
|
|
|
| import 'package:kernel/ast.dart' as ir;
|
|
|
| -import '../closure.dart' show BoxLocal;
|
| +import '../closure.dart' show BoxLocal, ThisLocal;
|
| import '../common.dart';
|
| import '../common/names.dart' show Identifiers;
|
| import '../common/resolution.dart';
|
| @@ -32,6 +32,7 @@ import '../js_backend/no_such_method_registry.dart';
|
| import '../js_backend/runtime_types.dart';
|
| import '../js_model/closure.dart';
|
| import '../js_model/elements.dart';
|
| +import '../js_model/locals.dart';
|
| import '../native/enqueue.dart';
|
| import '../native/native.dart' as native;
|
| import '../native/resolver.dart';
|
| @@ -2199,8 +2200,18 @@ class JsKernelToElementMap extends KernelToElementMapBase
|
| closureData.orderedTypeSet = setBuilder.createOrderedTypeSet(
|
| closureData.supertype, const Link<InterfaceType>());
|
|
|
| + Local closureEntity;
|
| + if (node.parent is ir.FunctionDeclaration) {
|
| + ir.FunctionDeclaration parent = node.parent;
|
| + closureEntity = localsMap.getLocalVariable(parent.variable);
|
| + } else if (node.parent is ir.FunctionExpression) {
|
| + closureEntity = new JLocal('', localsMap.currentMember);
|
| + }
|
| + Local thisLocal =
|
| + info.hasThisLocal ? new ThisLocal(localsMap.currentMember) : null;
|
| +
|
| KernelClosureClass cls = new KernelClosureClass.fromScopeInfo(
|
| - classEntity, node, info, localsMap);
|
| + classEntity, node, info, localsMap, closureEntity, thisLocal);
|
| int i = 0;
|
| for (ir.VariableDeclaration variable in info.freeVariables) {
|
| // Make a corresponding field entity in this closure class for every
|
|
|