js/src/jit-test/tests/basic/spread-call-setcall.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/basic/spread-call-setcall.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,26 @@
     1.4 +load(libdir + "asserts.js");
     1.5 +
     1.6 +function g() {
     1.7 +}
     1.8 +
     1.9 +let a = {
    1.10 +  g: function() {
    1.11 +  }
    1.12 +};
    1.13 +
    1.14 +function check(expr) {
    1.15 +  assertThrowsInstanceOf(Function(expr), ReferenceError);
    1.16 +}
    1.17 +
    1.18 +check("g(...[]) = 1");
    1.19 +check("a.g(...[]) = 1");
    1.20 +check("eval(...['1']) = 1");
    1.21 +check("[g(...[])] = 1");
    1.22 +check("[a.g(...[])] = 1");
    1.23 +check("[eval(...['1'])] = 1");
    1.24 +check("({y: g(...[])}) = 1");
    1.25 +check("({y: a.g(...[])}) = 1");
    1.26 +check("({y: eval(...['1'])}) = 1");
    1.27 +check("g(...[]) ++");
    1.28 +check("a.g(...[]) ++");
    1.29 +check("eval(...['1']) ++");

mercurial