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

Unified Diff: dart/runtime/bin/builtin.dart

Issue 143153006: Version 1.1.3 (stable) (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.1/
Patch Set: Created 6 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 | « no previous file | dart/runtime/vm/gc_marker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/bin/builtin.dart
===================================================================
--- dart/runtime/bin/builtin.dart (revision 32272)
+++ dart/runtime/bin/builtin.dart (working copy)
@@ -216,14 +216,18 @@
// Relative URIs with scheme dart-ext should be resolved as if with no
// scheme.
resolved = baseUri.resolve(uri.path);
- var path = resolved.path;
if (resolved.scheme == 'package') {
// If we are resolving relative to a package URI we go directly to the
// file path and keep the dart-ext scheme. Otherwise, we will lose the
// package URI path part.
- path = _filePathFromPackageUri(resolved);
+ var path = _filePathFromPackageUri(resolved);
+ if (path.startsWith('http:')) {
+ throw "Native extensions not supported in "
+ "packages loaded over http: %path";
+ }
+ resolved = new Uri.file(path);
}
- resolved = new Uri(scheme: 'dart-ext', path: path);
+ resolved = new Uri(scheme: 'dart-ext', path: resolved.path);
} else {
resolved = baseUri.resolve(userString);
}
@@ -244,7 +248,9 @@
return uri.toFilePath();
break;
case 'dart-ext':
- return new Uri(scheme: 'file',
+ // Relative file URIs don't start with file:///.
+ var scheme = (uri.path.startsWith('/') ? 'file' : '');
+ return new Uri(scheme: scheme,
host: uri.host,
path: uri.path).toFilePath();
break;
« no previous file with comments | « no previous file | dart/runtime/vm/gc_marker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698