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

Unified Diff: test/splitting/expressions.stmt

Issue 846133002: Put conditional operators on the left. (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Update version. Created 5 years, 11 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/regression/80.unit ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/splitting/expressions.stmt
diff --git a/test/splitting/expressions.stmt b/test/splitting/expressions.stmt
index 55640203258e3eff50a20ada94a5c9a3897475d1..ed1f452bc285c8cb0bbda09e2fa105b97392befc 100644
--- a/test/splitting/expressions.stmt
+++ b/test/splitting/expressions.stmt
@@ -33,15 +33,15 @@ if (identifier && identifier ||
>>> split conditional because then doesn't fit
var kind = element != null ? longArgument : arg;
<<<
-var kind = element != null ?
- longArgument :
- arg;
+var kind = element != null
+ ? longArgument
+ : arg;
>>> split conditional because else doesn't fit
var kind = element != null ? argument : secondArgumentThatIsReallyLong;
<<<
-var kind = element != null ?
- argument :
- secondArgumentThatIsReallyLong;
+var kind = element != null
+ ? argument
+ : secondArgumentThatIsReallyLong;
>>> unsplit operator chains before and after block
first + second + () {body;} + third + fourth;
<<<
@@ -97,10 +97,10 @@ someFunction(
>>> conditional operands are nested
identifier ? identifier ? someParticularlyLongOperand : someParticularlyLongOperand : identifier ? someParticularlyLongOperand : someParticularlyLongOperand;
<<<
-identifier ?
- identifier ?
- someParticularlyLongOperand :
- someParticularlyLongOperand :
- identifier ?
- someParticularlyLongOperand :
- someParticularlyLongOperand;
+identifier
+ ? identifier
+ ? someParticularlyLongOperand
+ : someParticularlyLongOperand
+ : identifier
+ ? someParticularlyLongOperand
+ : someParticularlyLongOperand;
« no previous file with comments | « test/regression/80.unit ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698