| 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 ClassStubGenerator get _stubGenerator => | 9 ClassStubGenerator get _stubGenerator => |
| 10 new ClassStubGenerator(compiler, namer, backend); | 10 new ClassStubGenerator(compiler, namer, backend); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) { |
| 63 List<String> fieldNames = <String>[]; | 63 List<jsAst.Name> fieldNames = <jsAst.Name>[]; |
| 64 | 64 |
| 65 if (!compiler.useContentSecurityPolicy) return; | 65 if (!compiler.useContentSecurityPolicy) return; |
| 66 | 66 |
| 67 if (!cls.onlyForRti && !cls.isNative) { | 67 if (!cls.onlyForRti && !cls.isNative) { |
| 68 fieldNames = cls.fields.map((Field field) => field.name).toList(); | 68 fieldNames = cls.fields.map((Field field) => field.name).toList(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 ClassElement classElement = cls.element; | 71 ClassElement classElement = cls.element; |
| 72 | 72 |
| 73 jsAst.Expression constructorAst = | 73 jsAst.Expression constructorAst = |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 ? new Selector.getter(member.name, member.library) | 566 ? new Selector.getter(member.name, member.library) |
| 567 : new Selector.setter(member.name, member.library); | 567 : new Selector.setter(member.name, member.library); |
| 568 String reflectionName = emitter.getReflectionName(selector, name); | 568 String reflectionName = emitter.getReflectionName(selector, name); |
| 569 if (reflectionName != null) { | 569 if (reflectionName != null) { |
| 570 var reflectable = | 570 var reflectable = |
| 571 js(backend.isAccessibleByReflection(member) ? '1' : '0'); | 571 js(backend.isAccessibleByReflection(member) ? '1' : '0'); |
| 572 builder.addPropertyByName('+$reflectionName', reflectable); | 572 builder.addPropertyByName('+$reflectionName', reflectable); |
| 573 } | 573 } |
| 574 } | 574 } |
| 575 } | 575 } |
| OLD | NEW |