js/src/jit-test/tests/arrow-functions/arguments-4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/arrow-functions/arguments-4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,14 @@
     1.4 +// 'arguments' is banned in a function with a rest param,
     1.5 +// even nested in an arrow-function parameter default value
     1.6 +
     1.7 +load(libdir + "asserts.js");
     1.8 +
     1.9 +var mistakes = [
    1.10 +    "(...rest) => arguments",
    1.11 +    "(...rest) => (x=arguments) => 0",
    1.12 +    "function f(...rest) { return (x=arguments) => 0; }",
    1.13 +    "function f(...rest) { return (x=(y=arguments) => 1) => 0; }",
    1.14 +];
    1.15 +
    1.16 +for (var s of mistakes)
    1.17 +    assertThrowsInstanceOf(function () { eval(s); }, SyntaxError);

mercurial