| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 closureToClassMapper; | 5 library closureToClassMapper; |
| 6 | 6 |
| 7 import 'common/names.dart' show Identifiers; | 7 import 'common/names.dart' show Identifiers; |
| 8 import 'common/resolution.dart' show ParsingContext, Resolution; | 8 import 'common/resolution.dart' show ParsingContext, Resolution; |
| 9 import 'common/tasks.dart' show CompilerTask; | 9 import 'common/tasks.dart' show CompilerTask; |
| 10 import 'common.dart'; | 10 import 'common.dart'; |
| 11 import 'compiler.dart' show Compiler; | 11 import 'compiler.dart' show Compiler; |
| 12 import 'constants/expressions.dart'; | 12 import 'constants/expressions.dart'; |
| 13 import 'elements/resolution_types.dart'; | 13 import 'elements/resolution_types.dart'; |
| 14 import 'elements/elements.dart'; | 14 import 'elements/elements.dart'; |
| 15 import 'elements/entities.dart'; | 15 import 'elements/entities.dart'; |
| 16 import 'elements/entity_utils.dart' as utils; |
| 16 import 'elements/modelx.dart' | 17 import 'elements/modelx.dart' |
| 17 show BaseFunctionElementX, ClassElementX, ElementX; | 18 show BaseFunctionElementX, ClassElementX, ElementX; |
| 18 import 'elements/visitor.dart' show ElementVisitor; | 19 import 'elements/visitor.dart' show ElementVisitor; |
| 19 import 'js_backend/js_backend.dart' show JavaScriptBackend; | 20 import 'js_backend/js_backend.dart' show JavaScriptBackend; |
| 20 import 'resolution/tree_elements.dart' show TreeElements; | 21 import 'resolution/tree_elements.dart' show TreeElements; |
| 21 import 'package:front_end/src/fasta/scanner.dart' show Token; | 22 import 'package:front_end/src/fasta/scanner.dart' show Token; |
| 22 import 'tree/tree.dart'; | 23 import 'tree/tree.dart'; |
| 23 import 'util/util.dart'; | 24 import 'util/util.dart'; |
| 24 import 'world.dart' show ClosedWorldRefiner; | 25 import 'world.dart' show ClosedWorldRefiner; |
| 25 | 26 |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 enclosingElement.kind == ElementKind.CLASS || | 1064 enclosingElement.kind == ElementKind.CLASS || |
| 1064 enclosingElement.kind == ElementKind.FUNCTION || | 1065 enclosingElement.kind == ElementKind.FUNCTION || |
| 1065 enclosingElement.kind == ElementKind.GETTER || | 1066 enclosingElement.kind == ElementKind.GETTER || |
| 1066 enclosingElement.kind == ElementKind.SETTER); | 1067 enclosingElement.kind == ElementKind.SETTER); |
| 1067 enclosingElement = enclosingElement.enclosingElement) { | 1068 enclosingElement = enclosingElement.enclosingElement) { |
| 1068 // TODO(johnniwinther): Simplify computed names. | 1069 // TODO(johnniwinther): Simplify computed names. |
| 1069 if (enclosingElement.isGenerativeConstructor || | 1070 if (enclosingElement.isGenerativeConstructor || |
| 1070 enclosingElement.isGenerativeConstructorBody || | 1071 enclosingElement.isGenerativeConstructorBody || |
| 1071 enclosingElement.isFactoryConstructor) { | 1072 enclosingElement.isFactoryConstructor) { |
| 1072 ConstructorElement constructor = enclosingElement; | 1073 ConstructorElement constructor = enclosingElement; |
| 1073 parts = parts.prepend(Elements.reconstructConstructorName(constructor)); | 1074 parts = parts.prepend(utils.reconstructConstructorName(constructor)); |
| 1074 } else { | 1075 } else { |
| 1075 String surroundingName = | 1076 String surroundingName = |
| 1076 Elements.operatorNameToIdentifier(enclosingElement.name); | 1077 Elements.operatorNameToIdentifier(enclosingElement.name); |
| 1077 parts = parts.prepend(surroundingName); | 1078 parts = parts.prepend(surroundingName); |
| 1078 } | 1079 } |
| 1079 // A generative constructors's parent is the class; the class name is | 1080 // A generative constructors's parent is the class; the class name is |
| 1080 // already part of the generative constructor's name. | 1081 // already part of the generative constructor's name. |
| 1081 if (enclosingElement.kind == ElementKind.GENERATIVE_CONSTRUCTOR) break; | 1082 if (enclosingElement.kind == ElementKind.GENERATIVE_CONSTRUCTOR) break; |
| 1082 } | 1083 } |
| 1083 StringBuffer sb = new StringBuffer(); | 1084 StringBuffer sb = new StringBuffer(); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 /// | 1241 /// |
| 1241 /// Move the below classes to a JS model eventually. | 1242 /// Move the below classes to a JS model eventually. |
| 1242 /// | 1243 /// |
| 1243 abstract class JSEntity implements Entity { | 1244 abstract class JSEntity implements Entity { |
| 1244 Entity get declaredEntity; | 1245 Entity get declaredEntity; |
| 1245 } | 1246 } |
| 1246 | 1247 |
| 1247 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1248 abstract class PrivatelyNamedJSEntity implements JSEntity { |
| 1248 Entity get rootOfScope; | 1249 Entity get rootOfScope; |
| 1249 } | 1250 } |
| OLD | NEW |