summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-31 01:52:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:20 -0500
commita8efb670df4f76cbfeab976d3b2a898a065da8f6 (patch)
treeec9983171045c4619211cf95c23bd10302a3d5dc
parent999d0eb6e866c8027c0e1197a58d229f1e14f37e (diff)
downloadsamba-a8efb670df4f76cbfeab976d3b2a898a065da8f6.tar.gz
samba-a8efb670df4f76cbfeab976d3b2a898a065da8f6.tar.bz2
samba-a8efb670df4f76cbfeab976d3b2a898a065da8f6.zip
r7128: added recursion to bugs list
(This used to be commit 645e645a4ee94af5cb8d6021c63a48322478582c)
-rw-r--r--testprogs/ejs/bugs.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/testprogs/ejs/bugs.js b/testprogs/ejs/bugs.js
index 3a211f3bdc..01174f9eaf 100644
--- a/testprogs/ejs/bugs.js
+++ b/testprogs/ejs/bugs.js
@@ -69,8 +69,27 @@ function objbug() {
}
+/****************************************
+demo lack of recursion
+fix in http://build.samba.org/build.pl?function=diff;tree=samba4;revision=7127
+*****************************************/
+function fibonacci(n) {
+ if (n < 3) {
+ return 1;
+ }
+ return fibonacci(n-1) + fibonacci(n-2);
+}
+
+function recursebug() {
+ println("First 10 fibonacci numbers:");
+ for (i=0;i<10;i++) {
+ println("fibonacci(" + i + ")=" + fibonacci(i));
+ }
+}
+
/* run the tests */
arraybug();
argsbug("one", "two", "three");
+recursebug();
objbug()