js/src/jit-test/tests/arguments/inline-rest-array-creation.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 function zero(...rest)
     2 {
     3   assertEq(rest.length, 0, "zero rest wrong length");
     4 }
     6 function tzero()
     7 {
     8   zero();
     9 }
    11 tzero(); tzero(); tzero();
    13 function one(...rest)
    14 {
    15   assertEq(rest.length, 1, "one rest wrong length");
    16 }
    18 function tone()
    19 {
    20   one(0);
    21 }
    23 tone(); tone(); tone();
    25 function two(...rest)
    26 {
    27   assertEq(rest.length, 2, "two rest wrong length");
    28 }
    30 function ttwo()
    31 {
    32   two(0, 1);
    33 }
    35 ttwo(); ttwo(); ttwo();
    37 function zeroWithLeading0(x, ...rest)
    38 {
    39   assertEq(rest.length, 0, "zeroWithLeading0 rest wrong length");
    40 }
    42 function tzeroWithLeading0()
    43 {
    44   zeroWithLeading0();
    45 }
    47 tzeroWithLeading0(); tzeroWithLeading0(); tzeroWithLeading0();
    49 function zeroWithLeading1(x, ...rest)
    50 {
    51   assertEq(rest.length, 0, "zeroWithLeading1 rest wrong length");
    52 }
    54 function tzeroWithLeading1()
    55 {
    56   zeroWithLeading1(0);
    57 }
    59 tzeroWithLeading1(); tzeroWithLeading1(); tzeroWithLeading1();
    61 function oneWithLeading(x, ...rest)
    62 {
    63   assertEq(rest.length, 1, "oneWithLeading rest wrong length");
    64 }
    66 function toneWithLeading()
    67 {
    68   oneWithLeading(0, 1);
    69 }
    71 toneWithLeading(); toneWithLeading(); toneWithLeading();
    73 function twoWithLeading(x, ...rest)
    74 {
    75   assertEq(rest.length, 2, "twoWithLeading rest wrong length");
    76 }
    78 function ttwoWithLeading()
    79 {
    80   twoWithLeading(0, 1, 2);
    81 }
    83 ttwoWithLeading(); ttwoWithLeading(); ttwoWithLeading();

mercurial