michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: if (typeof options == "function") { michael@0: var opts = options(); michael@0: if (!/\bstrict_mode\b/.test(opts)) michael@0: options("strict_mode"); michael@0: } michael@0: michael@0: var ok = false; michael@0: try { michael@0: eval('foo = true;'); michael@0: } catch (e) { michael@0: if (/^ReferenceError:/.test(e.toString())) michael@0: ok = true; michael@0: } michael@0: michael@0: if (ok) michael@0: reportCompare(0, 0, "ok"); michael@0: else michael@0: reportCompare(true, false, "this should have thrown a ReferenceError");