| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if (code == 0) { | 219 if (code == 0) { |
| 220 compiler.internalError(field, | 220 compiler.internalError(field, |
| 221 'Field code is 0 ($element/$field).'); | 221 'Field code is 0 ($element/$field).'); |
| 222 } else { | 222 } else { |
| 223 fieldCode = FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE]; | 223 fieldCode = FIELD_CODE_CHARACTERS[code - FIRST_FIELD_CODE]; |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 if (backend.isAccessibleByReflection(field)) { | 226 if (backend.isAccessibleByReflection(field)) { |
| 227 reflectionMarker = '-'; | 227 reflectionMarker = '-'; |
| 228 if (backend.isNeededForReflection(field)) { | 228 if (backend.isNeededForReflection(field)) { |
| 229 DartType type = field.computeType(compiler); | 229 DartType type = field.type; |
| 230 reflectionMarker = '-${task.metadataEmitter.reifyType(type)}'; | 230 reflectionMarker = '-${task.metadataEmitter.reifyType(type)}'; |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 builder.addField('$fieldName$fieldCode$reflectionMarker'); | 233 builder.addField('$fieldName$fieldCode$reflectionMarker'); |
| 234 fieldsAdded = true; | 234 fieldsAdded = true; |
| 235 } | 235 } |
| 236 }); | 236 }); |
| 237 } | 237 } |
| 238 | 238 |
| 239 if (hasMetadata) { | 239 if (hasMetadata) { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 computeTypeVariable = | 610 computeTypeVariable = |
| 611 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); | 611 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); |
| 612 } | 612 } |
| 613 jsAst.Expression convertRtiToRuntimeType = | 613 jsAst.Expression convertRtiToRuntimeType = |
| 614 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); | 614 namer.elementAccess(compiler.findHelper('convertRtiToRuntimeType')); |
| 615 builder.addProperty(name, | 615 builder.addProperty(name, |
| 616 js('function () { return #(#) }', | 616 js('function () { return #(#) }', |
| 617 [convertRtiToRuntimeType, computeTypeVariable])); | 617 [convertRtiToRuntimeType, computeTypeVariable])); |
| 618 } | 618 } |
| 619 } | 619 } |
| OLD | NEW |