Implement function destructuring argument support. (#3322)
Furthermore create unmapped arguments objects if a function has a non-simple argument. A few destructuring pattern issues were fixed as well. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
359643b5b2
commit
8bdb32cc88
@@ -78,3 +78,18 @@ assert (g2 () === 11);
|
||||
assert (g2 (1) === 3);
|
||||
assert (g2 (1, 2) === 3);
|
||||
assert (g2 (1, 2, 3) === 4);
|
||||
|
||||
function args(a, ...b)
|
||||
{
|
||||
assert(a === 1);
|
||||
assert(arguments[0] === 1);
|
||||
|
||||
a = 5;
|
||||
|
||||
assert(a === 5);
|
||||
assert(arguments[0] === 1);
|
||||
|
||||
assert(arguments[1] === 2);
|
||||
assert(b[0] === 2)
|
||||
}
|
||||
args(1, 2);
|
||||
|
||||
Reference in New Issue
Block a user