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; |