Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: pkg/compiler/lib/src/js_emitter/model.dart

Issue 868473003: dart2js: Run prepareNativeClasses in the program builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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,
herhut 2015/01/26 13:50:14 I am not very keen on this pattern. I assume this
floitsch 2015/01/26 17:50:40 I don't think I agree. Devs should run their code
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698