blob: 30274d780de150d43dbf5e5be32449a07fc80af6 [file] [log] [blame]
//@ runDefault
function test(when)
{
/bar/.exec("foo bar baz");
function validateContexts(when)
{
if (RegExp.leftContext !== "foo ")
throw "Error: " + when + ": bad leftContext: " + RegExp.leftContext;
if (RegExp.rightContext !== " baz")
throw "Error: " + when + ": bad rightContext: " + RegExp.rightContext;
}
if (when === "before")
validateContexts("before");
RegExp.input = "";
if (when === "after")
validateContexts("after");
}
test("before");
test("after");