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

if (typeof options == "function") {
    var opts = options();
    if (!/\bstrict_mode\b/.test(opts))
        options("strict_mode");
}

var ok = false;
try {
    eval('foo = true;');
} catch (e) {
    if (/^ReferenceError:/.test(e.toString()))
        ok = true;
}

if (ok)
    reportCompare(0, 0, "ok");
else
    reportCompare(true, false, "this should have thrown a ReferenceError");