diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/arguments/rest-basic.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/arguments/rest-basic.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,15 @@ +function check(expected, ...rest) { + assertEq(expected.toString(), rest.toString()); +} + +assertEq(check.length, 1); +check([]); +check(['a', 'b'], 'a', 'b'); +check(['a', 'b', 'c', 'd'], 'a', 'b', 'c', 'd'); +check.apply(null, [['a', 'b'], 'a', 'b']) +check.call(null, ['a', 'b'], 'a', 'b') + +var g = newGlobal(); +g.eval("function f(...rest) { return rest; }"); +var a = g.f(1, 2, 3); +assertEq(a instanceof g.Array, true); \ No newline at end of file