summaryrefslogtreecommitdiffstats
path: root/js/src/tests/js1_8_5/regress/regress-699682.js
blob: ad1b4e41ee16797c786ae51f08bca6cd5bcaacd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/

// Don't assert trying to parse any of these.
var a = ["({''})",
         "({''} = {})",
         "var {''};",
         "var {'', a} = {a: 0};",
         "var {'bad'};",
         "({'bad'} = {bad: 0});",
         "var {'if'};",
         "function f({''}) {}",
         "function f({a, 'bad', c}) {}"];

var x;
for (var i = 0; i < a.length; i++) {
    x = undefined;
    try {
        eval(a[i]);
    } catch (exc) {
        x = exc;
    }
    assertEq(x instanceof SyntaxError, true);
}
assertEq("" in this, false);
assertEq("bad" in this, false);
assertEq("if" in this, false);

reportCompare(0, 0, 'ok');