| 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 library dart2js.js_emitter.full_emitter.class_builder; |
| 6 |
| 7 import '../../elements/elements.dart' |
| 8 show |
| 9 ClassElement, |
| 10 Element; |
| 11 import '../../js/js.dart' as jsAst; |
| 12 import '../../js/js.dart' show js; |
| 13 import '../../js_backend/js_backend.dart' |
| 14 show |
| 15 Namer; |
| 6 | 16 |
| 7 /** | 17 /** |
| 8 * A data structure for collecting fragments of a class definition. | 18 * A data structure for collecting fragments of a class definition. |
| 9 */ | 19 */ |
| 10 class ClassBuilder { | 20 class ClassBuilder { |
| 11 final List<jsAst.Property> properties = <jsAst.Property>[]; | 21 final List<jsAst.Property> properties = <jsAst.Property>[]; |
| 12 final List<jsAst.Literal> fields = <jsAst.Literal>[]; | 22 final List<jsAst.Literal> fields = <jsAst.Literal>[]; |
| 13 | 23 |
| 14 jsAst.Name superName; | 24 jsAst.Name superName; |
| 15 jsAst.Node functionType; | 25 jsAst.Node functionType; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 fieldsAndProperties = <jsAst.Property>[]; | 91 fieldsAndProperties = <jsAst.Property>[]; |
| 82 fieldsAndProperties.add(new jsAst.Property( | 92 fieldsAndProperties.add(new jsAst.Property( |
| 83 js.string(namer.classDescriptorProperty), classData)); | 93 js.string(namer.classDescriptorProperty), classData)); |
| 84 fieldsAndProperties.addAll(properties); | 94 fieldsAndProperties.addAll(properties); |
| 85 } else { | 95 } else { |
| 86 fieldsAndProperties = properties; | 96 fieldsAndProperties = properties; |
| 87 } | 97 } |
| 88 return new jsAst.ObjectInitializer(fieldsAndProperties, isOneLiner: false); | 98 return new jsAst.ObjectInitializer(fieldsAndProperties, isOneLiner: false); |
| 89 } | 99 } |
| 90 } | 100 } |
| OLD | NEW |