| 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 library dart2js.js_emitter.full_emitter.class_emitter; | 5 library dart2js.js_emitter.full_emitter.class_emitter; |
| 6 | 6 |
| 7 import '../../common.dart'; | 7 import '../../common.dart'; |
| 8 import '../../common/names.dart' show Names; | 8 import '../../common/names.dart' show Names; |
| 9 import '../../elements/resolution_types.dart' show ResolutionDartType; | 9 import '../../elements/resolution_types.dart' show ResolutionDartType; |
| 10 import '../../deferred_load.dart' show OutputUnit; | 10 import '../../deferred_load.dart' show OutputUnit; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // TODO(herhut): This is a no-op. Should it be removed? | 265 // TODO(herhut): This is a no-op. Should it be removed? |
| 266 for (Field field in cls.fields) { | 266 for (Field field in cls.fields) { |
| 267 emitter.containerBuilder.addMemberField(field, builder); | 267 emitter.containerBuilder.addMemberField(field, builder); |
| 268 } | 268 } |
| 269 | 269 |
| 270 for (Method method in cls.methods) { | 270 for (Method method in cls.methods) { |
| 271 assert(invariant(classElement, method.element.isInstanceMember)); | 271 assert(invariant(classElement, method.element.isInstanceMember)); |
| 272 emitter.containerBuilder.addMemberMethod(method, builder); | 272 emitter.containerBuilder.addMemberMethod(method, builder); |
| 273 } | 273 } |
| 274 | 274 |
| 275 if (classElement.isObject && backend.backendUsage.isNoSuchMethodUsed) { | 275 if (classElement.isObject && closedWorld.backendUsage.isNoSuchMethodUsed) { |
| 276 // Emit the noSuchMethod handlers on the Object prototype now, | 276 // Emit the noSuchMethod handlers on the Object prototype now, |
| 277 // so that the code in the dynamicFunction helper can find | 277 // so that the code in the dynamicFunction helper can find |
| 278 // them. Note that this helper is invoked before analyzing the | 278 // them. Note that this helper is invoked before analyzing the |
| 279 // full JS script. | 279 // full JS script. |
| 280 emitter.nsmEmitter.emitNoSuchMethodHandlers(builder.addProperty); | 280 emitter.nsmEmitter.emitNoSuchMethodHandlers(builder.addProperty); |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 /// Emits the members from the model. | 284 /// Emits the members from the model. |
| 285 void emitRuntimeTypeInformation(Class cls, ClassBuilder builder) { | 285 void emitRuntimeTypeInformation(Class cls, ClassBuilder builder) { |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 String reflectionName = emitter.getReflectionName(selector, name); | 442 String reflectionName = emitter.getReflectionName(selector, name); |
| 443 if (reflectionName != null) { | 443 if (reflectionName != null) { |
| 444 var reflectable = js( | 444 var reflectable = js( |
| 445 backend.mirrorsData.isMemberAccessibleByReflection(member) | 445 backend.mirrorsData.isMemberAccessibleByReflection(member) |
| 446 ? '1' | 446 ? '1' |
| 447 : '0'); | 447 : '0'); |
| 448 builder.addPropertyByName('+$reflectionName', reflectable); | 448 builder.addPropertyByName('+$reflectionName', reflectable); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 } | 451 } |
| OLD | NEW |