| Index: pkg/compiler/lib/src/js_model/js_strategy.dart
|
| diff --git a/pkg/compiler/lib/src/js_model/js_strategy.dart b/pkg/compiler/lib/src/js_model/js_strategy.dart
|
| index 227c2856343475dc92077642cb08ec4091dacdf1..99dc8e0793eb5c8d6ec29f5fd037c7f66d53c014 100644
|
| --- a/pkg/compiler/lib/src/js_model/js_strategy.dart
|
| +++ b/pkg/compiler/lib/src/js_model/js_strategy.dart
|
| @@ -4,6 +4,8 @@
|
|
|
| library dart2js.js_model.strategy;
|
|
|
| +import 'package:kernel/ast.dart' as ir;
|
| +
|
| import '../closure.dart' show ClosureConversionTask;
|
| import '../common.dart';
|
| import '../common/tasks.dart';
|
| @@ -382,11 +384,22 @@ class JsClosedWorld extends ClosedWorldBase with KernelClosedWorldMixin {
|
| classHierarchyNodes,
|
| classSets);
|
|
|
| - @override
|
| - void registerClosureClass(ClassEntity cls) {
|
| + /// Construct a closure class and set up the necessary class inference
|
| + /// hierarchy.
|
| + KernelClosureClass buildClosureClass(String name, JLibrary enclosingLibrary,
|
| + KernelScopeInfo info, ir.Location location, KernelToLocalsMap localsMap) {
|
| + ClassEntity superclass = commonElements.closureClass;
|
| +
|
| + KernelClosureClass cls = elementMap.constructClosureClass(
|
| + name,
|
| + enclosingLibrary,
|
| + info,
|
| + location,
|
| + localsMap,
|
| + new InterfaceType(superclass, const []));
|
| +
|
| // Tell the hierarchy that this is the super class. then we can use
|
| // .getSupertypes(class)
|
| - ClassEntity superclass = commonElements.closureClass;
|
| ClassHierarchyNode parentNode = getClassHierarchyNode(superclass);
|
| ClassHierarchyNode node = new ClassHierarchyNode(
|
| parentNode, cls, getHierarchyDepth(superclass) + 1);
|
| @@ -398,7 +411,13 @@ class JsClosedWorld extends ClosedWorldBase with KernelClosedWorldMixin {
|
| subtypeSet.addSubtype(node);
|
| }
|
| addClassSet(cls, new ClassSet(node));
|
| - elementMap.addClosureClass(cls, new InterfaceType(superclass, const []));
|
| node.isDirectlyInstantiated = true;
|
| +
|
| + return cls;
|
| + }
|
| +
|
| + @override
|
| + void registerClosureClass(ClassEntity cls) {
|
| + throw new UnsupportedError('JsClosedWorld.registerClosureClass');
|
| }
|
| }
|
|
|