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, Statement; | 7 import '../js/js.dart' as js show Expression, Statement; |
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; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 /// This list must be emitted in the `METADATA` embedded global. | 48 /// This list must be emitted in the `METADATA` embedded global. |
49 /// The list references constants and must hence be emitted after constants | 49 /// The list references constants and must hence be emitted after constants |
50 /// have been initialized. | 50 /// have been initialized. |
51 /// | 51 /// |
52 /// Note: the metadata is derived from the task's `metadataCollector`. The | 52 /// Note: the metadata is derived from the task's `metadataCollector`. The |
53 /// list must not be emitted before all operations on it are done. For | 53 /// list must not be emitted before all operations on it are done. For |
54 /// example, the old emitter generates metadata when emitting reflection | 54 /// example, the old emitter generates metadata when emitting reflection |
55 /// data. | 55 /// data. |
56 List<String> get metadata => _metadataCollector.globalMetadata; | 56 List<String> get metadata => _metadataCollector.globalMetadata; |
57 | 57 |
58 /// A list of pretty-printed JavaScript expressions. | 58 /// A map with lists of pretty-printed JavaScript expressions. |
59 /// | 59 /// |
60 /// This list must be emitted in the `TYPES` embedded global. | 60 /// There is one list for each output unit. The list belonging to the main |
61 /// The list references constants and must hence be emitted after constants | 61 /// unit must be emitted in the `TYPES` embedded global. The list references |
62 /// have been initialized. | 62 /// constants and must hence be emitted after constants have been initialized. |
63 /// | 63 /// |
64 /// Note: the metadata is derived from the task's `metadataCollector`. The | 64 /// Note: the metadata is derived from the task's `metadataCollector`. The |
65 /// list must not be emitted before all operations on it are done. For | 65 /// list must not be emitted before all operations on it are done. For |
66 /// example, the old emitter generates metadata when emitting reflection | 66 /// example, the old emitter generates metadata when emitting reflection |
67 /// data. | 67 /// data. |
68 List<String> get metadataTypes => _metadataCollector.types; | 68 Map<OutputUnit, List<String>> get metadataTypes |
| 69 => _metadataCollector.types; |
| 70 |
69 | 71 |
70 bool get isSplit => fragments.length > 1; | 72 bool get isSplit => fragments.length > 1; |
71 Iterable<Fragment> get deferredFragments => fragments.skip(1); | 73 Iterable<Fragment> get deferredFragments => fragments.skip(1); |
72 } | 74 } |
73 | 75 |
74 /** | 76 /** |
75 * This class represents a JavaScript object that contains static state, like | 77 * This class represents a JavaScript object that contains static state, like |
76 * classes or functions. | 78 * classes or functions. |
77 */ | 79 */ |
78 class Holder { | 80 class Holder { |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 requiredParameterCount: requiredParameterCount, | 480 requiredParameterCount: requiredParameterCount, |
479 optionalParameterDefaultValues: optionalParameterDefaultValues, | 481 optionalParameterDefaultValues: optionalParameterDefaultValues, |
480 functionType: functionType); | 482 functionType: functionType); |
481 } | 483 } |
482 | 484 |
483 class StaticStubMethod extends StubMethod implements StaticMethod { | 485 class StaticStubMethod extends StubMethod implements StaticMethod { |
484 Holder holder; | 486 Holder holder; |
485 StaticStubMethod(String name, this.holder, js.Expression code) | 487 StaticStubMethod(String name, this.holder, js.Expression code) |
486 : super(name, code); | 488 : super(name, code); |
487 } | 489 } |
OLD | NEW |