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.full_emitter; | 5 part of dart2js.js_emitter.full_emitter; |
6 | 6 |
7 class ClassEmitter extends CodeEmitterHelper { | 7 class ClassEmitter extends CodeEmitterHelper { |
8 | 8 |
9 ClassStubGenerator get _stubGenerator => | 9 ClassStubGenerator get _stubGenerator => |
10 new ClassStubGenerator(compiler, namer, backend); | 10 new ClassStubGenerator(compiler, namer, backend); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 emitInstanceMembers(cls, builder); | 42 emitInstanceMembers(cls, builder); |
43 emitStubs(cls.callStubs, builder); | 43 emitStubs(cls.callStubs, builder); |
44 emitStubs(cls.typeVariableReaderStubs, builder); | 44 emitStubs(cls.typeVariableReaderStubs, builder); |
45 emitRuntimeTypeInformation(cls, builder); | 45 emitRuntimeTypeInformation(cls, builder); |
46 emitNativeInfo(cls, builder); | 46 emitNativeInfo(cls, builder); |
47 | 47 |
48 if (classElement == backend.closureClass) { | 48 if (classElement == backend.closureClass) { |
49 // We add a special getter here to allow for tearing off a closure from | 49 // We add a special getter here to allow for tearing off a closure from |
50 // itself. | 50 // itself. |
51 jsAst.Fun function = js('function() { return this; }'); | 51 jsAst.Fun function = js('function() { return this; }'); |
52 jsAst.Name name = namer.getterForMember(Selector.CALL_NAME); | 52 jsAst.Name name = namer.getterForMember(Names.call); |
53 builder.addProperty(name, function); | 53 builder.addProperty(name, function); |
54 } | 54 } |
55 | 55 |
56 emitClassBuilderWithReflectionData(cls, builder, enclosingBuilder, | 56 emitClassBuilderWithReflectionData(cls, builder, enclosingBuilder, |
57 fragment); | 57 fragment); |
58 } | 58 } |
59 /** | 59 /** |
60 * Emits the precompiled constructor when in CSP mode. | 60 * Emits the precompiled constructor when in CSP mode. |
61 */ | 61 */ |
62 void emitConstructorsForCSP(Class cls) { | 62 void emitConstructorsForCSP(Class cls) { |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 : new Selector.setter( | 427 : new Selector.setter( |
428 new Name(member.name, member.library, isSetter: true)); | 428 new Name(member.name, member.library, isSetter: true)); |
429 String reflectionName = emitter.getReflectionName(selector, name); | 429 String reflectionName = emitter.getReflectionName(selector, name); |
430 if (reflectionName != null) { | 430 if (reflectionName != null) { |
431 var reflectable = | 431 var reflectable = |
432 js(backend.isAccessibleByReflection(member) ? '1' : '0'); | 432 js(backend.isAccessibleByReflection(member) ? '1' : '0'); |
433 builder.addPropertyByName('+$reflectionName', reflectable); | 433 builder.addPropertyByName('+$reflectionName', reflectable); |
434 } | 434 } |
435 } | 435 } |
436 } | 436 } |
OLD | NEW |