michael@0: // 'arguments' is banned in a function with a rest param, michael@0: // even nested in an arrow-function parameter default value michael@0: michael@0: load(libdir + "asserts.js"); michael@0: michael@0: var mistakes = [ michael@0: "(...rest) => arguments", michael@0: "(...rest) => (x=arguments) => 0", michael@0: "function f(...rest) { return (x=arguments) => 0; }", michael@0: "function f(...rest) { return (x=(y=arguments) => 1) => 0; }", michael@0: ]; michael@0: michael@0: for (var s of mistakes) michael@0: assertThrowsInstanceOf(function () { eval(s); }, SyntaxError);