summaryrefslogtreecommitdiff
path: root/testprogs/ejs/bugs.js
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-12 06:57:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:20:10 -0500
commit26a55c330a8cd79da290b2ad0e15aaf94be6ebcf (patch)
tree85c23207c8baac99d60163bb3e3089d7e2cabb04 /testprogs/ejs/bugs.js
parent102e24761189306fdf6233481ada43e99a56b5e7 (diff)
downloadsamba-26a55c330a8cd79da290b2ad0e15aaf94be6ebcf.tar.gz
samba-26a55c330a8cd79da290b2ad0e15aaf94be6ebcf.tar.bz2
samba-26a55c330a8cd79da290b2ad0e15aaf94be6ebcf.zip
r8355: - added a vsprintf() function
- removed the --outputdir option from provision, as its not used any more (as ejs knows the real paths) (This used to be commit abbf9c703c17c2edc2d978dade3619a96c38d0d9)
Diffstat (limited to 'testprogs/ejs/bugs.js')
-rw-r--r--testprogs/ejs/bugs.js34
1 files changed, 33 insertions, 1 deletions
diff --git a/testprogs/ejs/bugs.js b/testprogs/ejs/bugs.js
index 01174f9eaf..3c8a4daab3 100644
--- a/testprogs/ejs/bugs.js
+++ b/testprogs/ejs/bugs.js
@@ -8,6 +8,7 @@
/****************************************
demo a bug in constructing arrays
fix at http://build.samba.org/build.pl?function=diff;tree=samba4;revision=7124
+status: FIXED
*****************************************/
function arraybug() {
var a;
@@ -38,6 +39,7 @@ function arraybug() {
/****************************************
demo a bug in variable arguments
fix at http://build.samba.org/build.pl?function=diff;tree=samba4;revision=7085
+status: FIXED
*****************************************/
function argsbug() {
println("we should have been called with 3 arguments");
@@ -51,6 +53,7 @@ function argsbug() {
/****************************************
demo a bug in constructing objects
no fix available yet
+status: SUBMITTED
*****************************************/
function MyObj() {
var o = new Object();
@@ -68,10 +71,23 @@ function objbug() {
assert(o2.test == 42);
}
+/*
+ demo a expression handling bug
+ status: SUBMITTED
+*/
+function exprbug() {
+ var a = new Array(10);
+ var i;
+ for (i=0;i<4;i++) {
+ a[1+(i*2)] = i;
+ a[2+(i*2)] = i*2;
+ }
+}
/****************************************
demo lack of recursion
fix in http://build.samba.org/build.pl?function=diff;tree=samba4;revision=7127
+status: FIXED
*****************************************/
function fibonacci(n) {
if (n < 3) {
@@ -87,9 +103,25 @@ function recursebug() {
}
}
+/****************************************
+demo lack of function variables inside functions
+status: FIXED IN SAMBA
+*****************************************/
+function callback()
+{
+ return "testing";
+}
+
+function fnbug(c)
+{
+ s = c();
+ assert(s == "testing");
+}
/* run the tests */
arraybug();
argsbug("one", "two", "three");
recursebug();
-objbug()
+exprbug();
+fnbug(callback);
+objbug();