michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: // Don't assert trying to parse any of these. michael@0: var a = ["({''})", michael@0: "({''} = {})", michael@0: "var {''};", michael@0: "var {'', a} = {a: 0};", michael@0: "var {'bad'};", michael@0: "({'bad'} = {bad: 0});", michael@0: "var {'if'};", michael@0: "function f({''}) {}", michael@0: "function f({a, 'bad', c}) {}"]; michael@0: michael@0: var x; michael@0: for (var i = 0; i < a.length; i++) { michael@0: x = undefined; michael@0: try { michael@0: eval(a[i]); michael@0: } catch (exc) { michael@0: x = exc; michael@0: } michael@0: assertEq(x instanceof SyntaxError, true); michael@0: } michael@0: assertEq("" in this, false); michael@0: assertEq("bad" in this, false); michael@0: assertEq("if" in this, false); michael@0: michael@0: reportCompare(0, 0, 'ok');