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

Unified Diff: runtime/vm/parser.cc

Issue 1131793012: Ensure libraries always have at least one top-level class and therefore at least one script. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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 | « runtime/vm/object.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 3dc9370481d463c84d6f8361e2968c63e84f7bcb..c7b2b8d509532e16e333db4f4b41fe96b6659ac5 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -5970,7 +5970,9 @@ void Parser::ParseTopLevel() {
}
}
}
- if ((top_level.fields.Length() > 0) || (top_level.functions.Length() > 0)) {
+
+ if ((library_.num_anonymous_classes() == 0) ||
+ (top_level.fields.Length() > 0) || (top_level.functions.Length() > 0)) {
toplevel_class.AddFields(top_level.fields);
const Array& array = Array::Handle(Z,
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698