OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_emitter.runtime_type_generator; | 5 library dart2js.js_emitter.runtime_type_generator; |
6 | 6 |
7 import '../closure.dart' | 7 import '../closure.dart' |
8 show ClosureRepresentationInfo, ClosureFieldElement, ClosureConversionTask; | 8 show ClosureRepresentationInfo, ClosureFieldElement, ClosureConversionTask; |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 result.addIsTest(other, _namer.operatorIs(other), js('1')); | 168 result.addIsTest(other, _namer.operatorIs(other), js('1')); |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 void generateFunctionTypeSignature( | 172 void generateFunctionTypeSignature( |
173 FunctionEntity method, FunctionType type) { | 173 FunctionEntity method, FunctionType type) { |
174 assert(!(method is MethodElement && !method.isImplementation)); | 174 assert(!(method is MethodElement && !method.isImplementation)); |
175 jsAst.Expression thisAccess = new jsAst.This(); | 175 jsAst.Expression thisAccess = new jsAst.This(); |
176 if (!method.isAbstract) { | 176 if (!method.isAbstract) { |
177 ClosureRepresentationInfo closureData = | 177 ClosureRepresentationInfo closureData = |
178 _closureDataLookup.getClosureRepresentationInfo(method); | 178 _closureDataLookup.getMemberRepresentationInfo(method); |
179 if (closureData != null) { | 179 if (closureData != null) { |
180 ClosureFieldElement thisLocal = closureData.thisFieldEntity; | 180 ClosureFieldElement thisLocal = closureData.thisFieldEntity; |
181 if (thisLocal != null) { | 181 if (thisLocal != null) { |
182 jsAst.Name thisName = _namer.instanceFieldPropertyName(thisLocal); | 182 jsAst.Name thisName = _namer.instanceFieldPropertyName(thisLocal); |
183 thisAccess = js('this.#', thisName); | 183 thisAccess = js('this.#', thisName); |
184 } | 184 } |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 if (storeFunctionTypeInMetadata && !type.containsTypeVariables) { | 188 if (storeFunctionTypeInMetadata && !type.containsTypeVariables) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 389 |
390 // We need to also emit "is checks" for the superclass and its supertypes. | 390 // We need to also emit "is checks" for the superclass and its supertypes. |
391 ClassEntity superclass = _elementEnvironment.getSuperClass(cls); | 391 ClassEntity superclass = _elementEnvironment.getSuperClass(cls); |
392 if (superclass != null) { | 392 if (superclass != null) { |
393 tryEmitTest(superclass); | 393 tryEmitTest(superclass); |
394 _generateInterfacesIsTests( | 394 _generateInterfacesIsTests( |
395 superclass, generateIsTest, generateSubstitution, alreadyGenerated); | 395 superclass, generateIsTest, generateSubstitution, alreadyGenerated); |
396 } | 396 } |
397 } | 397 } |
398 } | 398 } |
OLD | NEW |