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

Side by Side Diff: lib/src/info.dart

Issue 1011153002: js: fix core.Object, output order, static const fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | lib/src/js/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Defines static information collected by the type checker and used later by 5 /// Defines static information collected by the type checker and used later by
6 /// emitters to generate code. 6 /// emitters to generate code.
7 library dev_compiler.src.info; 7 library dev_compiler.src.info;
8 8
9 import 'dart:mirrors'; 9 import 'dart:mirrors';
10 10
(...skipping 29 matching lines...) Expand all
40 final bool isEntry; 40 final bool isEntry;
41 41
42 /// Corresponding analyzer element. 42 /// Corresponding analyzer element.
43 final LibraryElement library; 43 final LibraryElement library;
44 44
45 LibraryInfo(library, this.isEntry) 45 LibraryInfo(library, this.isEntry)
46 : library = library, 46 : library = library,
47 name = utils.canonicalLibraryName(library); 47 name = utils.canonicalLibraryName(library);
48 } 48 }
49 49
50 class LibraryUnit {
51 final CompilationUnit library;
52 final List<CompilationUnit> parts;
53
54 LibraryUnit(this.library, this.parts);
55
56 Iterable<CompilationUnit> get libraryThenParts sync* {
57 yield library;
58 yield* parts;
59 }
60
61 Iterable<CompilationUnit> get partsThenLibrary sync* {
62 yield* parts;
63 yield library;
64 }
65 }
66
50 // The abstract type of coercions mapping one type to another. 67 // The abstract type of coercions mapping one type to another.
51 // This class also exposes static builder functions which 68 // This class also exposes static builder functions which
52 // check for errors and reduce redundant coercions to the identity. 69 // check for errors and reduce redundant coercions to the identity.
53 abstract class Coercion { 70 abstract class Coercion {
54 final DartType fromType; 71 final DartType fromType;
55 final DartType toType; 72 final DartType toType;
56 Coercion(this.fromType, this.toType); 73 Coercion(this.fromType, this.toType);
57 static Coercion cast(DartType fromT, DartType toT) => new Cast(fromT, toT); 74 static Coercion cast(DartType fromT, DartType toT) => new Cast(fromT, toT);
58 static Coercion identity(DartType type) => new Identity(type); 75 static Coercion identity(DartType type) => new Identity(type);
59 static Coercion error() => new CoercionError(); 76 static Coercion error() => new CoercionError();
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 for (var cls in declarations.where((d) => d is ClassMirror)) { 599 for (var cls in declarations.where((d) => d is ClassMirror)) {
583 if (cls.isSubtypeOf(infoMirror)) { 600 if (cls.isSubtypeOf(infoMirror)) {
584 allTypes.add(cls); 601 allTypes.add(cls);
585 baseTypes.add(cls.superclass); 602 baseTypes.add(cls.superclass);
586 } 603 }
587 } 604 }
588 allTypes.removeAll(baseTypes); 605 allTypes.removeAll(baseTypes);
589 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType)) 606 return new List<Type>.from(allTypes.map((mirror) => mirror.reflectedType))
590 ..sort((t1, t2) => '$t1'.compareTo('$t2')); 607 ..sort((t1, t2) => '$t1'.compareTo('$t2'));
591 }(); 608 }();
OLDNEW
« no previous file with comments | « lib/src/codegen/js_codegen.dart ('k') | lib/src/js/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698