js/src/jit-test/tests/basic/spread-call-maxarg.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-maxarg.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,30 @@
     1.4 +
     1.5 +var config = getBuildConfiguration();
     1.6 +
     1.7 +// FIXME: ASAN and debug builds run this too slowly for now.  Re-enable
     1.8 +// after bug 919948 lands.
     1.9 +if (!config.debug && !config.asan) {
    1.10 +    let a = [];
    1.11 +    a.length = getMaxArgs() + 1;
    1.12 +
    1.13 +    let f = function() {
    1.14 +    };
    1.15 +
    1.16 +    try {
    1.17 +        f(...a);
    1.18 +    } catch (e) {
    1.19 +        assertEq(e.message, "too many function arguments");
    1.20 +    }
    1.21 +
    1.22 +    try {
    1.23 +        new f(...a);
    1.24 +    } catch (e) {
    1.25 +        assertEq(e.message, "too many constructor arguments");
    1.26 +    }
    1.27 +
    1.28 +    try {
    1.29 +        eval(...a);
    1.30 +    } catch (e) {
    1.31 +        assertEq(e.message, "too many function arguments");
    1.32 +    }
    1.33 +}

mercurial