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

Unified Diff: runtime/bin/main.cc

Issue 9254026: Split dart:builtin into dart:builtin and dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment and add binaries. 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 | « runtime/bin/io_sources.gypi ('k') | runtime/bin/stdio.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 4827ab10ce7d7094c62a34b71195718e60f4ac5c..be36001948ce097ab2d804fb505987e7e96632f0 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -253,11 +253,16 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
return DartUtils::CanonicalizeURL(NULL, library, url_string);
}
if (is_dart_scheme_url) {
- return Dart_Error("Do not know how to load '%s'", url_string);
+ // Handle imports of dart:io.
+ if (DartUtils::IsDartIOLibURL(url_string) && (tag == kImportTag)) {
+ return Builtin::LoadLibrary(Builtin::kIOLibrary);
+ } else {
+ return Dart_Error("Do not know how to load '%s'", url_string);
+ }
}
result = DartUtils::LoadSource(NULL, library, url, tag, url_string);
if (!Dart_IsError(result) && (tag == kImportTag)) {
- Builtin::ImportLibrary(result);
+ Builtin::ImportLibrary(result, Builtin::kBuiltinLibrary);
}
return result;
}
@@ -308,11 +313,13 @@ static bool CreateIsolateAndSetup(const char* name_prefix,
return false;
}
if (script_snapshot_buffer == NULL) {
- Builtin::ImportLibrary(library); // Implicitly import builtin into app.
+ // Implicitly import builtin into app.
+ Builtin::ImportLibrary(library, Builtin::kBuiltinLibrary);
}
if (snapshot_buffer != NULL) {
// Setup the native resolver as the snapshot does not carry it.
- Builtin::SetNativeResolver();
+ Builtin::SetNativeResolver(Builtin::kBuiltinLibrary);
+ Builtin::SetNativeResolver(Builtin::kIOLibrary);
}
Dart_ExitScope();
return true;
« no previous file with comments | « runtime/bin/io_sources.gypi ('k') | runtime/bin/stdio.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698