summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/spread-array-decompile.js
blob: 10939664dd3e05ca6a97f633e37763fe8c628a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var samples = [
    "[...a]",
    "[...[1]]",
    "[1, ...a, 2]",
    "[1, ...[2, 3], 4]",
    "[...[1], , ]",
    "[1, , ...[2]]",
    "[, 1, ...[2], ...[3], , 4, 5, , ]"
];
for (var sample of samples) {
    var source = "function f() {\n    return " + sample + ";\n}";
    eval(source);
    assertEq(f.toString(), source);
}