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

Unified Diff: packages/dart_style/test/regression/0300/0370.stmt

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years 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
Index: packages/dart_style/test/regression/0300/0370.stmt
diff --git a/packages/dart_style/test/regression/0300/0370.stmt b/packages/dart_style/test/regression/0300/0370.stmt
index 086bbf8f9904207c64a02a015a43bbb4ee6cd811..4f936d6a79a608853b097cd89fb9610cb15d33a9 100644
--- a/packages/dart_style/test/regression/0300/0370.stmt
+++ b/packages/dart_style/test/regression/0300/0370.stmt
@@ -36,35 +36,40 @@ return environment.barback.getAssetById(id).then((result) {
return notFound(request, asset: id);
});
<<<
-return environment.barback.getAssetById(id).then((result) {
- return result;
-}).then((asset) => _serveAsset(request, asset)).catchError((error, trace) {
- if (error is! AssetNotFoundException) throw error;
- return environment.barback
- .getAssetById(id.addExtension("/index.html"))
- .then((asset) {
- if (request.url.path.endsWith('/')) return _serveAsset(request, asset);
+return environment.barback
+ .getAssetById(id)
+ .then((result) {
+ return result;
+ })
+ .then((asset) => _serveAsset(request, asset))
+ .catchError((error, trace) {
+ if (error is! AssetNotFoundException) throw error;
+ return environment.barback
+ .getAssetById(id.addExtension("/index.html"))
+ .then((asset) {
+ if (request.url.path.endsWith('/')) return _serveAsset(request, asset);
- // We only want to serve index.html if the URL explicitly ends in a
- // slash. For other URLs, we redirect to one with the slash added to
- // implicitly support that too. This follows Apache's behavior.
- logRequest(request, "302 Redirect to ${request.url}/");
- return new shelf.Response.found('${request.url}/');
- }).catchError((newError, newTrace) {
- // If we find neither the original file or the index, we should report
- // the error about the original to the user.
- throw newError is AssetNotFoundException ? error : newError;
- });
-}).catchError((error, trace) {
- if (error is! AssetNotFoundException) {
- trace = new Chain.forTrace(trace);
- logRequest(request, "$error\n$trace");
+ // We only want to serve index.html if the URL explicitly ends in a
+ // slash. For other URLs, we redirect to one with the slash added to
+ // implicitly support that too. This follows Apache's behavior.
+ logRequest(request, "302 Redirect to ${request.url}/");
+ return new shelf.Response.found('${request.url}/');
+ }).catchError((newError, newTrace) {
+ // If we find neither the original file or the index, we should report
+ // the error about the original to the user.
+ throw newError is AssetNotFoundException ? error : newError;
+ });
+ })
+ .catchError((error, trace) {
+ if (error is! AssetNotFoundException) {
+ trace = new Chain.forTrace(trace);
+ logRequest(request, "$error\n$trace");
- addError(error, trace);
- close();
- return new shelf.Response.internalServerError();
- }
+ addError(error, trace);
+ close();
+ return new shelf.Response.internalServerError();
+ }
- addResult(new BarbackServerResult._failure(request.url, id, error));
- return notFound(request, asset: id);
-});
+ addResult(new BarbackServerResult._failure(request.url, id, error));
+ return notFound(request, asset: id);
+ });
« no previous file with comments | « packages/dart_style/test/regression/0300/0367.stmt ('k') | packages/dart_style/test/regression/0300/0373.unit » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698