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