| 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_builder; | 5 library dart2js.js_emitter.full_emitter.class_builder; |
| 6 | 6 |
| 7 import '../../elements/elements.dart' show Entity; | |
| 8 import '../../elements/entities.dart'; | 7 import '../../elements/entities.dart'; |
| 9 import '../../js/js.dart' as jsAst; | 8 import '../../js/js.dart' as jsAst; |
| 10 import '../../js/js.dart' show js; | 9 import '../../js/js.dart' show js; |
| 11 import '../../js_backend/js_backend.dart' show Namer; | 10 import '../../js_backend/js_backend.dart' show Namer; |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * A data structure for collecting fragments of a class definition. | 13 * A data structure for collecting fragments of a class definition. |
| 15 */ | 14 */ |
| 16 class ClassBuilder { | 15 class ClassBuilder { |
| 17 final List<jsAst.Property> properties = <jsAst.Property>[]; | 16 final List<jsAst.Property> properties = <jsAst.Property>[]; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 fieldsAndProperties = <jsAst.Property>[]; | 86 fieldsAndProperties = <jsAst.Property>[]; |
| 88 fieldsAndProperties.add(new jsAst.Property( | 87 fieldsAndProperties.add(new jsAst.Property( |
| 89 js.string(namer.classDescriptorProperty), classData)); | 88 js.string(namer.classDescriptorProperty), classData)); |
| 90 fieldsAndProperties.addAll(properties); | 89 fieldsAndProperties.addAll(properties); |
| 91 } else { | 90 } else { |
| 92 fieldsAndProperties = properties; | 91 fieldsAndProperties = properties; |
| 93 } | 92 } |
| 94 return new jsAst.ObjectInitializer(fieldsAndProperties, isOneLiner: false); | 93 return new jsAst.ObjectInitializer(fieldsAndProperties, isOneLiner: false); |
| 95 } | 94 } |
| 96 } | 95 } |
| OLD | NEW |