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:
1 parent
292d99ba4e
commit
c8a16f2107
2 files changed
+143
-12
No files matched your search
@@ -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