| 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; |
| 11 import '../../elements/elements.dart' | 11 import '../../elements/elements.dart' |
| 12 show ClassElement, FieldElement, MemberElement; | 12 show ClassElement, FieldElement, MemberElement; |
| 13 import '../../elements/names.dart'; | 13 import '../../elements/names.dart'; |
| 14 import '../../js/js.dart' as jsAst; | 14 import '../../js/js.dart' as jsAst; |
| 15 import '../../js/js.dart' show js; | 15 import '../../js/js.dart' show js; |
| 16 import '../../js_backend/js_backend.dart' show CompoundName, Namer; | 16 import '../../js_backend/js_backend.dart' show CompoundName, Namer; |
| 17 import '../../universe/selector.dart' show Selector; | 17 import '../../universe/selector.dart' show Selector; |
| 18 import '../../util/util.dart' show equalElements; | 18 import '../../util/util.dart' show equalElements; |
| 19 import '../../world.dart' show ClosedWorld; | 19 import '../../world.dart' show ClosedWorld; |
| 20 import '../js_emitter.dart' hide Emitter, EmitterFactory; | 20 import '../js_emitter.dart' hide Emitter, EmitterFactory; |
| 21 import '../model.dart'; | 21 import '../model.dart'; |
| 22 import 'emitter.dart'; | 22 import 'emitter.dart'; |
| 23 | 23 |
| 24 class ClassEmitter extends CodeEmitterHelper { | 24 class ClassEmitter extends CodeEmitterHelper { |
| 25 final ClosedWorld closedWorld; | 25 final ClosedWorld closedWorld; |
| 26 | 26 |
| 27 ClassEmitter(this.closedWorld); | 27 ClassEmitter(this.closedWorld); |
| 28 | 28 |
| 29 ClassStubGenerator get _stubGenerator => new ClassStubGenerator( | 29 ClassStubGenerator get _stubGenerator => new ClassStubGenerator(task.emitter, |
| 30 task.emitter, | 30 compiler.commonElements, namer, codegenWorldBuilder, closedWorld, |
| 31 compiler.commonElements, | |
| 32 namer, | |
| 33 codegenWorldBuilder, | |
| 34 backend.interceptorData, | |
| 35 closedWorld, | |
| 36 enableMinification: compiler.options.enableMinification); | 31 enableMinification: compiler.options.enableMinification); |
| 37 | 32 |
| 38 /** | 33 /** |
| 39 * Documentation wanted -- johnniwinther | 34 * Documentation wanted -- johnniwinther |
| 40 */ | 35 */ |
| 41 void emitClass(Class cls, ClassBuilder enclosingBuilder, Fragment fragment) { | 36 void emitClass(Class cls, ClassBuilder enclosingBuilder, Fragment fragment) { |
| 42 ClassElement classElement = cls.element; | 37 ClassElement classElement = cls.element; |
| 43 | 38 |
| 44 assert(invariant(classElement, classElement.isDeclaration)); | 39 assert(invariant(classElement, classElement.isDeclaration)); |
| 45 | 40 |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 String reflectionName = emitter.getReflectionName(selector, name); | 442 String reflectionName = emitter.getReflectionName(selector, name); |
| 448 if (reflectionName != null) { | 443 if (reflectionName != null) { |
| 449 var reflectable = js( | 444 var reflectable = js( |
| 450 backend.mirrorsData.isMemberAccessibleByReflection(member) | 445 backend.mirrorsData.isMemberAccessibleByReflection(member) |
| 451 ? '1' | 446 ? '1' |
| 452 : '0'); | 447 : '0'); |
| 453 builder.addPropertyByName('+$reflectionName', reflectable); | 448 builder.addPropertyByName('+$reflectionName', reflectable); |
| 454 } | 449 } |
| 455 } | 450 } |
| 456 } | 451 } |
| OLD | NEW |