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

Unified Diff: runtime/vm/unit_test.cc

Issue 14752008: Final step towards loading core library scripts directly from the sources (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/tools/concat_library.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.cc
===================================================================
--- runtime/vm/unit_test.cc (revision 22513)
+++ runtime/vm/unit_test.cc (working copy)
@@ -63,11 +63,19 @@
if (Dart_IsError(result)) {
return Dart_Error("accessing url characters failed");
}
+ Dart_Handle library_url = Dart_LibraryUrl(library);
+ const char* library_url_string = NULL;
+ result = Dart_StringToCString(library_url, &library_url_string);
+ if (Dart_IsError(result)) {
+ return result;
+ }
+
bool is_dart_scheme_url = DartUtils::IsDartSchemeURL(url_chars);
+ bool is_io_library = DartUtils::IsDartIOLibURL(library_url_string);
if (tag == kCanonicalizeUrl) {
// If this is a Dart Scheme URL then it is not modified as it will be
// handled by the VM internally.
- if (is_dart_scheme_url) {
+ if (is_dart_scheme_url || is_io_library) {
return url;
}
Dart_Handle builtin_lib =
@@ -86,6 +94,13 @@
return Dart_Error("Do not know how to load '%s'", url_chars);
}
}
+ if (is_io_library) {
+ ASSERT(tag == kSourceTag);
+ return Dart_LoadSource(library,
+ url,
+ Builtin::PartSource(Builtin::kIOLibrary,
+ url_chars));
+ }
return DartUtils::LoadSource(NULL,
library,
url,
« no previous file with comments | « runtime/tools/concat_library.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698