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

Unified Diff: frog/gen.dart

Issue 9113061: Reapply r3590 with frog fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/dom/templates/dom/frog/immutable_list_mixin.darttemplate ('k') | frog/minfrog » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/gen.dart
diff --git a/frog/gen.dart b/frog/gen.dart
index 4a1556ab493cad8570244475d797472d3133b136..e952a25f0563113223387c0918983c5dc4f0ba1a 100644
--- a/frog/gen.dart
+++ b/frog/gen.dart
@@ -37,13 +37,25 @@ class WorldGenerator {
WorldGenerator(this.main, this.writer)
: globals = {}, corejs = new CoreJs();
+
+
+
analyze() {
// Walk all code and find all NewExpressions - to determine possible types
int nlibs=0, ntypes=0, nmems=0, nnews=0;
- //Set<Type> newedTypes = new Set<Type>();
for (var lib in world.libraries.getValues()) {
nlibs += 1;
for (var type in lib.types.getValues()) {
+ // TODO(jmesserly): we can't accurately track if DOM types are
+ // created or not, so we need to prepare to handle them.
+ // This should be fixed by tightening up the return types in DOM.
+ // Until then, this 'analysis' just marks all the DOM types as used.
+ // TODO(jimhug): Do we still need this? Or do/can we handle this by
+ // using return values?
+ if (type.library.isDom || type.isHiddenNativeType) {
+ if (type.isClass) type.markUsed();
+ }
+
ntypes += 1;
var allMembers = [];
allMembers.addAll(type.constructors.getValues());
@@ -225,17 +237,6 @@ class WorldGenerator {
var orderedTypes = _orderValues(lib.types);
- // TODO(jmesserly): we can't accurately track if DOM types are
- // created or not, so we need to prepare to handle them.
- // This should be fixed by tightening up the return types in DOM.
- // Until then, this 'analysis' just marks all the DOM types as used.
- for (var type in orderedTypes) {
- if ((type.library.isDom || type.isHiddenNativeType) &&
- type.isClass) {
- type.markUsed();
- }
- }
-
for (var type in orderedTypes) {
if (type.isUsed && type.isClass) {
writeType(type);
« no previous file with comments | « client/dom/templates/dom/frog/immutable_list_mixin.darttemplate ('k') | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698