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:
@@ -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 ({
|
||||
|
||||
Reference in New Issue
Block a user