Index: sdk/lib/io/link.dart |
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart |
index d36d7796424212cbd1d37deba4c28784eeeda3da..bfe0cdc96a17ba154224026bbfba418de8c3d0c0 100644 |
--- a/sdk/lib/io/link.dart |
+++ b/sdk/lib/io/link.dart |
@@ -204,8 +204,17 @@ class _Link extends FileSystemEntity implements Link { |
} |
Future<String> target() { |
- // TODO(whesse): Replace with asynchronous version. |
- return new Future.sync(targetSync); |
+ _ensureFileService(); |
+ List request = new List(2); |
+ request[0] = _LINK_TARGET_REQUEST; |
+ request[1] = path; |
+ return _fileService.call(request).then((response) { |
+ if (_isErrorResponse(response)) { |
+ throw _exceptionFromResponse(response, |
+ "Cannot get target of link '$path'"); |
+ } |
+ return response; |
+ }); |
} |
String targetSync() { |