| 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; | |
| 17 final bool outputContainsConstantList; | 16 final bool outputContainsConstantList; |
| 18 final bool outputContainsNativeClasses; | 17 final bool outputContainsNativeClasses; |
| 19 /// A map from load id to the list of fragments that need to be loaded. | 18 /// A map from load id to the list of fragments that need to be loaded. |
| 20 final Map<String, List<Fragment>> loadMap; | 19 final Map<String, List<Fragment>> loadMap; |
| 21 | 20 |
| 22 /// Additional properties that have to be added to classes. | 21 /// Additional properties that have to be added to classes. |
| 23 final Map<Class, Map<String, js.Expression>> additionalProperties; | 22 final Map<Class, Map<String, js.Expression>> additionalProperties; |
| 24 | 23 |
| 25 Program(this.fragments, | 24 Program(this.fragments, |
| 26 this.nativeClasses, | |
| 27 this.additionalProperties, | 25 this.additionalProperties, |
| 28 this.loadMap, | 26 this.loadMap, |
| 29 {this.outputContainsNativeClasses, | 27 {this.outputContainsNativeClasses, |
| 30 this.outputContainsConstantList}) { | 28 this.outputContainsConstantList}) { |
| 31 assert(outputContainsNativeClasses != null); | 29 assert(outputContainsNativeClasses != null); |
| 32 assert(outputContainsConstantList != null); | 30 assert(outputContainsConstantList != null); |
| 33 } | 31 } |
| 34 | 32 |
| 35 bool get isSplit => fragments.length > 1; | 33 bool get isSplit => fragments.length > 1; |
| 36 Iterable<Fragment> get deferredFragments => fragments.skip(1); | 34 Iterable<Fragment> get deferredFragments => fragments.skip(1); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 StaticMethod(Element element, String name, this.holder, js.Expression code, | 319 StaticMethod(Element element, String name, this.holder, js.Expression code, |
| 322 {bool needsTearOff}) | 320 {bool needsTearOff}) |
| 323 : super(element, name, code, needsTearOff: needsTearOff); | 321 : super(element, name, code, needsTearOff: needsTearOff); |
| 324 } | 322 } |
| 325 | 323 |
| 326 class StaticStubMethod extends StaticMethod { | 324 class StaticStubMethod extends StaticMethod { |
| 327 StaticStubMethod(String name, Holder holder, js.Expression code, | 325 StaticStubMethod(String name, Holder holder, js.Expression code, |
| 328 {bool needsTearOff}) | 326 {bool needsTearOff}) |
| 329 : super(null, name, holder, code, needsTearOff: needsTearOff); | 327 : super(null, name, holder, code, needsTearOff: needsTearOff); |
| 330 } | 328 } |
| OLD | NEW |