| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.js_model.strategy; | 5 library dart2js.js_model.strategy; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' as ir; | 7 import 'package:kernel/ast.dart' as ir; |
| 8 | 8 |
| 9 import '../closure.dart' show ClosureConversionTask; | 9 import '../closure.dart' show ClosureConversionTask; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 enclosingLibrary, | 424 enclosingLibrary, |
| 425 info, | 425 info, |
| 426 location, | 426 location, |
| 427 localsMap, | 427 localsMap, |
| 428 new InterfaceType(superclass, const [])); | 428 new InterfaceType(superclass, const [])); |
| 429 | 429 |
| 430 // Tell the hierarchy that this is the super class. then we can use | 430 // Tell the hierarchy that this is the super class. then we can use |
| 431 // .getSupertypes(class) | 431 // .getSupertypes(class) |
| 432 ClassHierarchyNode parentNode = getClassHierarchyNode(superclass); | 432 ClassHierarchyNode parentNode = getClassHierarchyNode(superclass); |
| 433 ClassHierarchyNode node = new ClassHierarchyNode( | 433 ClassHierarchyNode node = new ClassHierarchyNode( |
| 434 parentNode, cls, getHierarchyDepth(superclass) + 1); | 434 parentNode, cls.closureClassEntity, getHierarchyDepth(superclass) + 1); |
| 435 addClassHierarchyNode(cls, node); | 435 addClassHierarchyNode(cls.closureClassEntity, node); |
| 436 for (InterfaceType type in getOrderedTypeSet(superclass).types) { | 436 for (InterfaceType type in getOrderedTypeSet(superclass).types) { |
| 437 // TODO(efortuna): assert that the FunctionClass is in this ordered set. | 437 // TODO(efortuna): assert that the FunctionClass is in this ordered set. |
| 438 // If not, we need to explicitly add node as a subtype of FunctionClass. | 438 // If not, we need to explicitly add node as a subtype of FunctionClass. |
| 439 ClassSet subtypeSet = getClassSet(type.element); | 439 ClassSet subtypeSet = getClassSet(type.element); |
| 440 subtypeSet.addSubtype(node); | 440 subtypeSet.addSubtype(node); |
| 441 } | 441 } |
| 442 addClassSet(cls, new ClassSet(node)); | 442 addClassSet(cls.closureClassEntity, new ClassSet(node)); |
| 443 node.isDirectlyInstantiated = true; | 443 node.isDirectlyInstantiated = true; |
| 444 | 444 |
| 445 return cls; | 445 return cls; |
| 446 } | 446 } |
| 447 | 447 |
| 448 @override | 448 @override |
| 449 void registerClosureClass(ClassEntity cls) { | 449 void registerClosureClass(ClassEntity cls) { |
| 450 throw new UnsupportedError('JsClosedWorld.registerClosureClass'); | 450 throw new UnsupportedError('JsClosedWorld.registerClosureClass'); |
| 451 } | 451 } |
| 452 } | 452 } |
| OLD | NEW |