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

Unified Diff: packages/dart_style/test/whitespace/functions.unit

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 | « packages/dart_style/test/whitespace/for.stmt ('k') | packages/dart_style/test/whitespace/if.stmt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/dart_style/test/whitespace/functions.unit
diff --git a/packages/dart_style/test/whitespace/functions.unit b/packages/dart_style/test/whitespace/functions.unit
new file mode 100644
index 0000000000000000000000000000000000000000..b79e1713cfe7bd78b8f5627ed13b9e6b5bf14b50
--- /dev/null
+++ b/packages/dart_style/test/whitespace/functions.unit
@@ -0,0 +1,78 @@
+40 columns |
+>>> external
+ external
+void
+printToConsole(line);
+<<<
+external void printToConsole(line);
+>>> nested functions
+x(){y(){z(){}}}
+<<<
+x() {
+ y() {
+ z() {}
+ }
+}
+>>> named parameters
+int a(var x, {optional: null}) => null;
+<<<
+int a(var x, {optional: null}) => null;
+>>> optional parameters
+int a(var x, [optional = null]) => null;
+<<<
+int a(var x, [optional = null]) => null;
+>>> async
+main()
+ async {
+ var x = () async=> 1;
+ y()async {}
+ var z = ()
+ async
+ {};
+}
+<<<
+main() async {
+ var x = () async => 1;
+ y() async {}
+ var z = () async {};
+}
+>>>
+fish() => []
+ ..add(1)
+ ..add(2);
+<<<
+fish() => []..add(1)..add(2);
+>>>
+fish() => []..add(1);
+<<<
+fish() => []..add(1);
+>>> empty function bodies are a single line
+void main() { }
+<<<
+void main() {}
+>>>
+void main() {
+
+}
+<<<
+void main() {}
+>>> DO use a space after : in named parameters
+foo({showScrollbars :false}) {}
+<<<
+foo({showScrollbars: false}) {}
+>>> DO use a spaces around = in optional positional parameters.
+listen([int port=80]) {}
+<<<
+listen([int port = 80]) {}
+>>> async*
+main()async *{var lambda = ()async *{};}
+<<<
+main() async* {
+ var lambda = () async* {};
+}
+>>> sync* functions
+main()sync *{var lambda = ()sync *{};}
+<<<
+main() sync* {
+ var lambda = () sync* {};
+}
« no previous file with comments | « packages/dart_style/test/whitespace/for.stmt ('k') | packages/dart_style/test/whitespace/if.stmt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698