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

Unified Diff: runtime/bin/dartutils.cc

Issue 203073004: Prefix io part uri's with 'dart:io/'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index f87f88233a216c07ccf0c978f437cc887ffea078..972b36a17c18d84ddbfc9a2dbff1bc38b520f78d 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -523,8 +523,16 @@ Dart_Handle DartUtils::LibraryTagHandler(Dart_LibraryTag tag,
// Handle 'part' of IO library.
if (is_io_library) {
if (tag == Dart_kSourceTag) {
+ // Prepend the library URI to form a unique script URI for the part.
+ intptr_t len = snprintf(NULL, 0, "%s/%s", library_url_string, url_string);
+ char* part_uri = reinterpret_cast<char*>(malloc(len + 1));
+ snprintf(part_uri, len + 1, "%s/%s", library_url_string, url_string);
+ Dart_Handle part_uri_obj = DartUtils::NewString(part_uri);
+ free(part_uri);
return Dart_LoadSource(
- library, url, Builtin::PartSource(Builtin::kIOLibrary, url_string));
+ library,
+ part_uri_obj,
+ Builtin::PartSource(Builtin::kIOLibrary, url_string));
} else {
ASSERT(tag == Dart_kImportTag);
return NewError("Unable to import '%s' ", url_string);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698