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

Unified Diff: sdk/lib/io/link.dart

Issue 2754013002: Format all dart: library files (Closed)
Patch Set: Format all dart: library files Created 3 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 | « sdk/lib/io/io_sink.dart ('k') | sdk/lib/io/platform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index 99b72c8c2c633733a38ffd6ec724464e70d23001..cc347800423b6011212a84ebdd328fecdd03bc46 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -101,7 +101,7 @@ abstract class Link implements FileSystemEntity {
*/
Future<Link> rename(String newPath);
- /**
+ /**
* Synchronously renames this link. Returns a [Link]
* instance for the renamed link.
*
@@ -143,14 +143,13 @@ abstract class Link implements FileSystemEntity {
String targetSync();
}
-
class _Link extends FileSystemEntity implements Link {
final String path;
_Link(this.path) {
if (path is! String) {
throw new ArgumentError('${Error.safeToString(path)} '
- 'is not a String');
+ 'is not a String');
}
}
@@ -166,17 +165,17 @@ class _Link extends FileSystemEntity implements Link {
if (Platform.isWindows) {
target = _makeWindowsLinkTarget(target);
}
- var result = recursive ? parent.create(recursive: true)
- : new Future.value(null);
+ var result =
+ recursive ? parent.create(recursive: true) : new Future.value(null);
return result
- .then((_) => _IOService._dispatch(_FILE_CREATE_LINK, [path, target]))
- .then((response) {
- if (_isErrorResponse(response)) {
- throw _exceptionFromResponse(
- response, "Cannot create link to target '$target'", path);
- }
- return this;
- });
+ .then((_) => _IOService._dispatch(_FILE_CREATE_LINK, [path, target]))
+ .then((response) {
+ if (_isErrorResponse(response)) {
+ throw _exceptionFromResponse(
+ response, "Cannot create link to target '$target'", path);
+ }
+ return this;
+ });
}
void createSync(String target, {bool recursive: false}) {
@@ -201,7 +200,7 @@ class _Link extends FileSystemEntity implements Link {
} else {
throw new FileSystemException(
'Target $result of Link.create on Windows cannot be converted' +
- ' to start with a drive letter. Unexpected error.');
+ ' to start with a drive letter. Unexpected error.');
}
}
@@ -243,14 +242,14 @@ class _Link extends FileSystemEntity implements Link {
}
Future<Link> rename(String newPath) {
- return _IOService._dispatch(_FILE_RENAME_LINK, [path, newPath])
- .then((response) {
- if (_isErrorResponse(response)) {
- throw _exceptionFromResponse(
- response, "Cannot rename link to '$newPath'", path);
- }
- return new Link(newPath);
- });
+ return _IOService
+ ._dispatch(_FILE_RENAME_LINK, [path, newPath]).then((response) {
+ if (_isErrorResponse(response)) {
+ throw _exceptionFromResponse(
+ response, "Cannot rename link to '$newPath'", path);
+ }
+ return new Link(newPath);
+ });
}
Link renameSync(String newPath) {
@@ -292,7 +291,7 @@ class _Link extends FileSystemEntity implements Link {
return new ArgumentError();
case _OSERROR_RESPONSE:
var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
- response[_OSERROR_RESPONSE_ERROR_CODE]);
+ response[_OSERROR_RESPONSE_ERROR_CODE]);
return new FileSystemException(message, path, err);
default:
return new Exception("Unknown error");
« no previous file with comments | « sdk/lib/io/io_sink.dart ('k') | sdk/lib/io/platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698