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

Side by Side Diff: src/tests/site/code/syntax.dart

Issue 22528003: update examples on homepage (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 import 'dart:html'; // Dart supports libraries...
2
3 class Rectangle implements Shape { // ...and classes.
4 final num height, width;
5 Rectangle(this.height, this.width); // Compact constructor syntax.
6 num perimeter() => 2*height + 2*width; // Function shorthand syntax.
sethladd 2013/08/08 05:06:29 should be a getter
Kathy Walrath 2013/08/08 17:09:38 Done.
7 }
8
9 // You can define functions either inside or outside of classes.
10 startOrEndTest() {
11 // ...
12 }
13
14 // Every app has a main() function, where execution starts.
15 main() {
16 // The cascade operator (..) saves you from repetitive typing.
17 query("#button")
18 ..text = "Run test"
19 ..onClick.listen(startOrEndTest);
20 }
21
22 class Shape {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698