Trim whitespace from argument names in Function constructor

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
This commit is contained in:
Dániel Bátyai
2015-08-06 10:44:46 +02:00
parent 58851bc7cc
commit b7d3189ac3
4 changed files with 93 additions and 2 deletions
+9
View File
@@ -71,6 +71,15 @@ 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);
var f = new Function (" a\t , b", "\u0020c", "return a + b + c;");
assert (f (1,2,3) === 6);
f = new Function ("a, \n b \u0020", "c \t, d\n", "return a + b + c + d;");
assert (f (1,2,3,4) === 10);
f = new Function (" a\t" , "\nb ", " \u0020c , d ", "return a + b + c + d;");
assert (f (1,2,3,4) === 10);
try
{
new Function ({