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

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: Cosmetic changes. 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
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index be408da173628d16664f23c45b14a8ebb812e258..4d6d13e30cd636dce97a8f485000531eb2995250 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -239,11 +239,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;
}
@@ -294,11 +299,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') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698