michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: // Contributor: michael@0: // Jeff Walden michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 999999; michael@0: var summary = '{ get x y() { } } is not valid getter syntax'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: var BAD_CODE = ["({ get x y() { } })", "({ set x y(v) { } })"]; michael@0: michael@0: for (var i = 0, sz = BAD_CODE.length; i < sz; i++) michael@0: { michael@0: var code = BAD_CODE[i]; michael@0: michael@0: var err = "no exception"; michael@0: try michael@0: { michael@0: eval(code); michael@0: } michael@0: catch (e) michael@0: { michael@0: err = e; michael@0: } michael@0: if (!(err instanceof SyntaxError)) michael@0: { michael@0: assertEq(true, false, michael@0: "bad or no exception thrown for eval(" + code + "): " + err); michael@0: } michael@0: michael@0: err = "no exception"; michael@0: try michael@0: { michael@0: new Function(code); michael@0: } michael@0: catch (e) michael@0: { michael@0: err = e; michael@0: } michael@0: if (!(err instanceof SyntaxError)) michael@0: { michael@0: assertEq(true, false, michael@0: "bad or no exception thrown for Function(" + code + "): " + err); michael@0: } michael@0: } michael@0: michael@0: reportCompare(true, true);