~ubuntu-branches/ubuntu/wily/mozjs17/wily

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/arguments/rest-basic.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function check(expected, ...rest) {
 
2
    assertEq(expected.toString(), rest.toString());
 
3
}
 
4
 
 
5
assertEq(check.length, 1);
 
6
check([]);
 
7
check(['a', 'b'], 'a', 'b');
 
8
check(['a', 'b', 'c', 'd'], 'a', 'b', 'c', 'd');
 
9
check.apply(null, [['a', 'b'], 'a', 'b'])
 
10
check.call(null, ['a', 'b'], 'a', 'b')
 
11
 
 
12
var g = newGlobal('new-compartment');
 
13
g.eval("function f(...rest) { return rest; }");
 
14
var a = g.f(1, 2, 3);
 
15
assertEq(a instanceof g.Array, true);
 
 
b'\\ No newline at end of file'