| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 class ClassEmitter extends CodeEmitterHelper { | 7 class ClassEmitter extends CodeEmitterHelper { |
| 8 /** | 8 /** |
| 9 * Documentation wanted -- johnniwinther | 9 * Documentation wanted -- johnniwinther |
| 10 * | 10 * |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 onlyForRti: onlyForRti); | 41 onlyForRti: onlyForRti); |
| 42 emitFields(classElement, builder, superName, onlyForRti: onlyForRti); | 42 emitFields(classElement, builder, superName, onlyForRti: onlyForRti); |
| 43 emitClassGettersSetters(classElement, builder, onlyForRti: onlyForRti); | 43 emitClassGettersSetters(classElement, builder, onlyForRti: onlyForRti); |
| 44 emitInstanceMembers(classElement, builder, onlyForRti: onlyForRti); | 44 emitInstanceMembers(classElement, builder, onlyForRti: onlyForRti); |
| 45 task.typeTestEmitter.emitIsTests(classElement, builder); | 45 task.typeTestEmitter.emitIsTests(classElement, builder); |
| 46 if (additionalProperties != null) { | 46 if (additionalProperties != null) { |
| 47 additionalProperties.forEach(builder.addProperty); | 47 additionalProperties.forEach(builder.addProperty); |
| 48 } | 48 } |
| 49 | 49 |
| 50 if (classElement == compiler.closureClass) { | 50 if (classElement == compiler.closureClass) { |
| 51 // We add a special getter here to allow for tearing off a closure form | 51 // We add a special getter here to allow for tearing off a closure from |
| 52 // itself. | 52 // itself. |
| 53 String name = namer.safeName(Compiler.CALL_OPERATOR_NAME); | 53 String name = namer.getMappedInstanceName(Compiler.CALL_OPERATOR_NAME); |
| 54 jsAst.Fun function = js('function() { return this; }'); | 54 jsAst.Fun function = js('function() { return this; }'); |
| 55 builder.addProperty(namer.getterNameFromAccessorName(name), function); | 55 builder.addProperty(namer.getterNameFromAccessorName(name), function); |
| 56 } | 56 } |
| 57 | 57 |
| 58 emitTypeVariableReaders(classElement, builder); | 58 emitTypeVariableReaders(classElement, builder); |
| 59 | 59 |
| 60 emitClassBuilderWithReflectionData( | 60 emitClassBuilderWithReflectionData( |
| 61 className, classElement, builder, properties); | 61 className, classElement, builder, properties); |
| 62 } | 62 } |
| 63 | 63 |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 computeTypeVariable = | 620 computeTypeVariable = |
| 621 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); | 621 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); |
| 622 } | 622 } |
| 623 jsAst.Expression convertRtiToRuntimeType = | 623 jsAst.Expression convertRtiToRuntimeType = |
| 624 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); | 624 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); |
| 625 builder.addProperty(name, | 625 builder.addProperty(name, |
| 626 js('function () { return #(#) }', | 626 js('function () { return #(#) }', |
| 627 [convertRtiToRuntimeType, computeTypeVariable])); | 627 [convertRtiToRuntimeType, computeTypeVariable])); |
| 628 } | 628 } |
| 629 } | 629 } |
| OLD | NEW |