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 [email protected]
This commit is contained in:
Peter Gal authored and Evgeny Gavrin committed 2015-07-15 15:33:10 +03:00
1 parent 292d99ba4e
commit c8a16f2107
2 files changed
+143 -12

No files matched your search

+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 ({