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

Unified Diff: test/dart_codegen/expect/core/exceptions.dart

Issue 959073002: Fix new line breaks on } (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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 | « test/dart_codegen/expect/core/errors.dart ('k') | test/dart_codegen/expect/core/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/dart_codegen/expect/core/exceptions.dart
diff --git a/test/dart_codegen/expect/core/exceptions.dart b/test/dart_codegen/expect/core/exceptions.dart
index c79ff0c5486b054f6096f76e30024b8b11c1c0c0..e3dc9622f101c597ac6823c5b5d09224be3301e2 100644
--- a/test/dart_codegen/expect/core/exceptions.dart
+++ b/test/dart_codegen/expect/core/exceptions.dart
@@ -37,9 +37,7 @@ String source = ((__x3) => DDC$RT.cast(__x3, dynamic, String, "CastGeneral", """
int lineNum = 1;
int lineStart = 0;
bool lastWasCR;
- for (int i = 0;
- i < offset;
- i++) {
+ for (int i = 0; i < offset; i++) {
int char = ((__x4) => DDC$RT.cast(__x4, dynamic, int, "CastGeneral", """line 123, column 18 of dart:core/exceptions.dart: """, __x4 is int, true))(source.codeUnitAt(i));
if (char == 0x0a) {
if (lineStart != i || !lastWasCR) {
@@ -55,22 +53,18 @@ int char = ((__x4) => DDC$RT.cast(__x4, dynamic, int, "CastGeneral", """line 123
}
}
if (lineNum > 1) {
-report += " (at line $lineNum, character ${offset - lineStart + 1}
-)\n";
+report += " (at line $lineNum, character ${offset - lineStart + 1})\n";
}
else {
-report += " (at character ${offset + 1}
-)\n";
+report += " (at character ${offset + 1})\n";
}
int lineEnd = DDC$RT.cast(source.length, dynamic, int, "CastGeneral", """line 141, column 19 of dart:core/exceptions.dart: """, source.length is int, true);
- for (int i = offset;
- i < source.length;
- i++) {
+ for (int i = offset; i < source.length; i++) {
int char = ((__x5) => DDC$RT.cast(__x5, dynamic, int, "CastGeneral", """line 143, column 18 of dart:core/exceptions.dart: """, __x5 is int, true))(source.codeUnitAt(i));
if (char == 0x0a || char == 0x0d) {
-lineEnd = i;
- break;
-}
+ lineEnd = i;
+ break;
+ }
}
int length = lineEnd - lineStart;
int start = lineStart;
@@ -80,23 +74,22 @@ lineEnd = i;
if (length > 78) {
int index = offset - lineStart;
if (index < 75) {
-end = start + 75;
- postfix = "...";
-}
+ end = start + 75;
+ postfix = "...";
+ }
else if (end - offset < 75) {
-start = end - 75;
- prefix = "...";
-}
+ start = end - 75;
+ prefix = "...";
+ }
else {
-start = offset - 36;
- end = offset + 36;
- prefix = postfix = "...";
-}
+ start = offset - 36;
+ end = offset + 36;
+ prefix = postfix = "...";
+ }
}
String slice = ((__x6) => DDC$RT.cast(__x6, dynamic, String, "CastGeneral", """line 171, column 20 of dart:core/exceptions.dart: """, __x6 is String, true))(source.substring(start, end));
int markOffset = offset - start + prefix.length;
- return "$report$prefix$slice$postfix\n${" " * markOffset}
-^\n";
+ return "$report$prefix$slice$postfix\n${" " * markOffset}^\n";
}
}
class IntegerDivisionByZeroException implements Exception {const IntegerDivisionByZeroException();
« no previous file with comments | « test/dart_codegen/expect/core/errors.dart ('k') | test/dart_codegen/expect/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698