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

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

Issue 10025040: Use interpolation instead of concatenation. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 8 years, 8 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
OLDNEW
1 <html> 1 <html>
2 <body> 2 <body>
3 3
4 <script type="application/dart"> 4 <script type="application/dart">
5 #import('dart:dom'); 5 #import('dart:dom');
6 6
7 // FIXME: Make this a unit test. 7 // FIXME: Make this a unit test.
8 HTMLBodyElement get body() { return document.body; } 8 HTMLBodyElement get body() { return document.body; }
9 9
10 void log(String msg) { 10 void log(String msg) {
11 HTMLElement element = document.createElement('div'); 11 HTMLElement element = document.createElement('div');
12 element.innerHTML = msg; 12 element.innerHTML = msg;
13 body.appendChild(element); 13 body.appendChild(element);
14 } 14 }
15 15
16 int fib(int n) { 16 int fib(int n) {
17 if (n < 2) 17 if (n < 2)
18 return n; 18 return n;
19 else 19 else
20 return fib(n - 1) + fib(n - 2); 20 return fib(n - 1) + fib(n - 2);
21 } 21 }
22 22
23 void main() { 23 void main() {
24 if (null !== layoutTestController) { 24 if (null !== layoutTestController) {
25 layoutTestController.dumpAsText(); 25 layoutTestController.dumpAsText();
26 } 26 }
27 log("fib(10) = " + fib(10)); 27 log("fib(10) = ${fib(10)}");
28 if (fib(10) != 55) { 28 if (fib(10) != 55) {
29 log("FAIL"); 29 log("FAIL");
30 return; 30 return;
31 } 31 }
32 log("PASS"); 32 log("PASS");
33 } 33 }
34 </script> 34 </script>
35 35
36 <script> 36 <script>
37 if (window.navigator.webkitStartDart) 37 if (window.navigator.webkitStartDart)
38 navigator.webkitStartDart(); 38 navigator.webkitStartDart();
39 </script> 39 </script>
40 40
41 </body> 41 </body>
42 </html> 42 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698