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

Unified Diff: runtime/bin/directory_patch.dart

Issue 2998373002: [dart:io] Move _getUriBaseClosure to dart:io (Closed)
Patch Set: Created 3 years, 4 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/bin/dartutils.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_patch.dart
diff --git a/runtime/bin/directory_patch.dart b/runtime/bin/directory_patch.dart
index 27ca94f44f7a4f0e7c5ee979a6c0f6996d3f5c83..5e4d24c57a85f927b621de1876d7ca8977d24052 100644
--- a/runtime/bin/directory_patch.dart
+++ b/runtime/bin/directory_patch.dart
@@ -46,3 +46,16 @@ class _AsyncDirectoryListerOpsImpl extends NativeFieldWrapperClass1
native "Directory_SetAsyncDirectoryListerPointer";
int getPointer() native "Directory_GetAsyncDirectoryListerPointer";
}
+
+// Corelib 'Uri.base' implementation.
+// Uri.base is susceptible to changes in the current working directory.
+Uri _uriBaseClosure() {
+ var result = _Directory._current();
+ if (result is OSError) {
+ throw new FileSystemException(
+ "Getting current working directory failed", "", result);
+ }
+ return new Uri.directory(result);
+}
+
+_getUriBaseClosure() => _uriBaseClosure;
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698