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

Side by Side Diff: LayoutTests/dart/fib.dart

Issue 9188009: Things to unfork. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/dart/dromaeo-based-tests-expected.txt ('k') | LayoutTests/dart/fib.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 class Main {
2 static int fib(int n) {
3 if (n < 2)
4 return n;
5 else
6 return fib(n - 1) + fib(n - 2);
7 }
8
9 // FIXME: Make this a unit test.
10 static HTMLBodyElement get body() { return document.body; }
11
12 static void main() {
13 log("fib(10) = " + fib(10));
14 if (fib(10) != 55) {
15 log("FAIL");
16 return;
17 }
18 log("PASS");
19 }
20
21 static void log(String msg) {
22 HTMLElement element = document.createElement('div');
23 element.innerHTML = msg;
24 body.appendChild(element);
25 }
26 }
OLDNEW
« no previous file with comments | « LayoutTests/dart/dromaeo-based-tests-expected.txt ('k') | LayoutTests/dart/fib.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698