| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.new_js_emitter.model; | 5 library dart2js.new_js_emitter.model; |
| 6 | 6 |
| 7 import '../js/js.dart' as js show Expression; | 7 import '../js/js.dart' as js show Expression; |
| 8 import '../constants/values.dart' show ConstantValue; | 8 import '../constants/values.dart' show ConstantValue; |
| 9 | 9 |
| 10 import '../deferred_load.dart' show OutputUnit; | 10 import '../deferred_load.dart' show OutputUnit; |
| 11 | 11 |
| 12 import '../common.dart'; | 12 import '../common.dart'; |
| 13 | 13 |
| 14 class Program { | 14 class Program { |
| 15 final List<Fragment> fragments; | 15 final List<Fragment> fragments; |
| 16 final List<Class> nativeClasses; | 16 final List<Class> nativeClasses; |
| 17 final bool outputContainsConstantList; | 17 final bool outputContainsConstantList; |
| 18 final bool outputContainsNativeClasses; |
| 18 /// A map from load id to the list of fragments that need to be loaded. | 19 /// A map from load id to the list of fragments that need to be loaded. |
| 19 final Map<String, List<Fragment>> loadMap; | 20 final Map<String, List<Fragment>> loadMap; |
| 20 | 21 |
| 22 /// Additional properties that have to be added to classes. |
| 23 final Map<Class, Map<String, js.Expression>> additionalProperties; |
| 24 |
| 21 Program(this.fragments, | 25 Program(this.fragments, |
| 22 this.nativeClasses, | 26 this.nativeClasses, |
| 23 this.outputContainsConstantList, | 27 this.additionalProperties, |
| 24 this.loadMap); | 28 this.loadMap, |
| 29 {this.outputContainsNativeClasses, |
| 30 this.outputContainsConstantList}) { |
| 31 assert(outputContainsNativeClasses != null); |
| 32 assert(outputContainsConstantList != null); |
| 33 } |
| 25 | 34 |
| 26 bool get isSplit => fragments.length > 1; | 35 bool get isSplit => fragments.length > 1; |
| 27 Iterable<Fragment> get deferredFragments => fragments.skip(1); | 36 Iterable<Fragment> get deferredFragments => fragments.skip(1); |
| 28 } | 37 } |
| 29 | 38 |
| 30 /** | 39 /** |
| 31 * This class represents a JavaScript object that contains static state, like | 40 * This class represents a JavaScript object that contains static state, like |
| 32 * classes or functions. | 41 * classes or functions. |
| 33 */ | 42 */ |
| 34 class Holder { | 43 class Holder { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 StaticMethod(Element element, String name, this.holder, js.Expression code, | 321 StaticMethod(Element element, String name, this.holder, js.Expression code, |
| 313 {bool needsTearOff}) | 322 {bool needsTearOff}) |
| 314 : super(element, name, code, needsTearOff: needsTearOff); | 323 : super(element, name, code, needsTearOff: needsTearOff); |
| 315 } | 324 } |
| 316 | 325 |
| 317 class StaticStubMethod extends StaticMethod { | 326 class StaticStubMethod extends StaticMethod { |
| 318 StaticStubMethod(String name, Holder holder, js.Expression code, | 327 StaticStubMethod(String name, Holder holder, js.Expression code, |
| 319 {bool needsTearOff}) | 328 {bool needsTearOff}) |
| 320 : super(null, name, holder, code, needsTearOff: needsTearOff); | 329 : super(null, name, holder, code, needsTearOff: needsTearOff); |
| 321 } | 330 } |
| OLD | NEW |