Improve Function constructor argument handling.

For the Function constructor it is possible to pass the
name of the function arguments in one or more strings, and
each argument name should be separated with a comma.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
Peter Gal
2015-07-10 15:29:43 +02:00
committed by Evgeny Gavrin
parent 292d99ba4e
commit c8a16f2107
2 changed files with 143 additions and 12 deletions
+9
View File
@@ -62,6 +62,15 @@ for (i = 1; i < 10; i ++)
}
}
var f = new Function ("a,b", "c", "return a + b + c;");
assert (f (1,2,3) === 6);
f = new Function ("a,b", "c,d", "return a + b + c + d;");
assert (f (1,2,3,4) === 10);
f = new Function ("a" , "b", "c,d", "return a + b + c + d;");
assert (f (1,2,3,4) === 10);
try
{
new Function ({