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

Unified Diff: runtime/vm/parser.cc

Issue 10949028: Fix for issue 5223 : Import 'dart:core' implicitly only if it has not been (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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/language/import_core_prefix_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 12667)
+++ runtime/vm/parser.cc (working copy)
@@ -4219,6 +4219,13 @@
ParseLibraryNameObsoleteSyntax();
ParseLibraryImportObsoleteSyntax();
ParseLibraryIncludeObsoleteSyntax();
+ // Core lib has not been explicitly imported, so we implicitly
+ // import it here.
+ if (!library_.ImportsCorelib()) {
+ Library& core_lib = Library::Handle(Library::CoreLibrary());
+ ASSERT(!core_lib.IsNull());
+ library_.AddImport(core_lib);
+ }
return;
}
@@ -4240,6 +4247,13 @@
metadata_pos = TokenPos();
SkipMetadata();
}
+ // Core lib has not been explicitly imported, so we implicitly
+ // import it here.
+ if (!library_.ImportsCorelib()) {
+ Library& core_lib = Library::Handle(Library::CoreLibrary());
+ ASSERT(!core_lib.IsNull());
+ library_.AddImport(core_lib);
+ }
while (IsLiteral("part")) {
ParseLibraryPart();
metadata_pos = TokenPos();
« no previous file with comments | « runtime/vm/object.cc ('k') | tests/language/import_core_prefix_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698