michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: var x = 0; michael@0: var y = 1; michael@0: var g = 1; michael@0: michael@0: var expect = "y"; michael@0: var actual; michael@0: michael@0: try { michael@0: eval("y: while (x) break\n/y/g.exec('y')"); michael@0: actual = RegExp.lastMatch; michael@0: } catch (e) { michael@0: actual = '' + e; michael@0: } michael@0: assertEq(actual, expect); michael@0: michael@0: try { michael@0: eval("y: while (x) continue\n/y/g.exec('y')"); michael@0: actual = RegExp.lastMatch; michael@0: } catch (e) { michael@0: actual = '' + e; michael@0: } michael@0: assertEq(actual, expect); michael@0: michael@0: reportCompare(0, 0, "ok");