michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: var gTestfile = 'object-literal-accessor-arguments.js'; michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 536472; michael@0: var summary = michael@0: 'ES5: { get x(v) { } } and { set x(v, v2) { } } should be syntax errors'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: function expectSyntaxError(s) michael@0: { michael@0: try michael@0: { michael@0: eval(s); michael@0: throw new Error("no error thrown"); michael@0: } michael@0: catch (e) michael@0: { michael@0: assertEq(e instanceof SyntaxError, true, michael@0: "expected syntax error parsing '" + s + "', got: " + e); michael@0: } michael@0: } michael@0: michael@0: expectSyntaxError("({ get x(a) { } })"); michael@0: expectSyntaxError("({ get x(a, a) { } })"); michael@0: expectSyntaxError("({ get x(a, b) { } })"); michael@0: expectSyntaxError("({ get x(a, a, b) { } })"); michael@0: expectSyntaxError("({ get x(a, b, c) { } })"); michael@0: michael@0: expectSyntaxError("({ set x() { } })"); michael@0: expectSyntaxError("({ set x(a, a) { } })"); michael@0: expectSyntaxError("({ set x(a, b) { } })"); michael@0: expectSyntaxError("({ set x(a, a, b) { } })"); michael@0: expectSyntaxError("({ set x(a, b, c) { } })"); michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: reportCompare(true, true);