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.dart'; | 7 import 'common.dart'; |
8 import 'common/names.dart' show Identifiers; | 8 import 'common/names.dart' show Identifiers; |
9 import 'common/resolution.dart' show ParsingContext, Resolution; | 9 import 'common/resolution.dart' show ParsingContext, Resolution; |
10 import 'common/tasks.dart' show CompilerTask; | 10 import 'common/tasks.dart' show CompilerTask; |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 // Extend [globalizedElement] as an instantiated class in the closed world. | 1049 // Extend [globalizedElement] as an instantiated class in the closed world. |
1050 compiler.world | 1050 compiler.world |
1051 .registerClass(globalizedElement, isDirectlyInstantiated: true); | 1051 .registerClass(globalizedElement, isDirectlyInstantiated: true); |
1052 FunctionElement callElement = new SynthesizedCallMethodElementX( | 1052 FunctionElement callElement = new SynthesizedCallMethodElementX( |
1053 Identifiers.call, element, globalizedElement, node, elements); | 1053 Identifiers.call, element, globalizedElement, node, elements); |
1054 backend.maybeMarkClosureAsNeededForReflection( | 1054 backend.maybeMarkClosureAsNeededForReflection( |
1055 globalizedElement, callElement, element); | 1055 globalizedElement, callElement, element); |
1056 MemberElement enclosing = element.memberContext; | 1056 MemberElement enclosing = element.memberContext; |
1057 enclosing.nestedClosures.add(callElement); | 1057 enclosing.nestedClosures.add(callElement); |
1058 globalizedElement.addMember(callElement, reporter); | 1058 globalizedElement.addMember(callElement, reporter); |
1059 globalizedElement.computeAllClassMembers(compiler); | 1059 globalizedElement.computeAllClassMembers(compiler.resolution); |
1060 // The nested function's 'this' is the same as the one for the outer | 1060 // The nested function's 'this' is the same as the one for the outer |
1061 // function. It could be [null] if we are inside a static method. | 1061 // function. It could be [null] if we are inside a static method. |
1062 ThisLocal thisElement = closureData.thisLocal; | 1062 ThisLocal thisElement = closureData.thisLocal; |
1063 | 1063 |
1064 return new ClosureClassMap( | 1064 return new ClosureClassMap( |
1065 element, globalizedElement, callElement, thisElement); | 1065 element, globalizedElement, callElement, thisElement); |
1066 } | 1066 } |
1067 | 1067 |
1068 void visitInvokable( | 1068 void visitInvokable( |
1069 ExecutableElement element, Node node, void visitChildren()) { | 1069 ExecutableElement element, Node node, void visitChildren()) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 /// | 1185 /// |
1186 /// Move the below classes to a JS model eventually. | 1186 /// Move the below classes to a JS model eventually. |
1187 /// | 1187 /// |
1188 abstract class JSEntity implements Entity { | 1188 abstract class JSEntity implements Entity { |
1189 Entity get declaredEntity; | 1189 Entity get declaredEntity; |
1190 } | 1190 } |
1191 | 1191 |
1192 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1192 abstract class PrivatelyNamedJSEntity implements JSEntity { |
1193 Entity get rootOfScope; | 1193 Entity get rootOfScope; |
1194 } | 1194 } |
OLD | NEW |