1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/ecma_3/Statements/regress-642975.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,30 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* 1.6 + * Any copyright is dedicated to the Public Domain. 1.7 + * http://creativecommons.org/licenses/publicdomain/ 1.8 + */ 1.9 + 1.10 +var x = 0; 1.11 +var y = 1; 1.12 +var g = 1; 1.13 + 1.14 +var expect = "y"; 1.15 +var actual; 1.16 + 1.17 +try { 1.18 + eval("y: while (x) break\n/y/g.exec('y')"); 1.19 + actual = RegExp.lastMatch; 1.20 +} catch (e) { 1.21 + actual = '' + e; 1.22 +} 1.23 +assertEq(actual, expect); 1.24 + 1.25 +try { 1.26 + eval("y: while (x) continue\n/y/g.exec('y')"); 1.27 + actual = RegExp.lastMatch; 1.28 +} catch (e) { 1.29 + actual = '' + e; 1.30 +} 1.31 +assertEq(actual, expect); 1.32 + 1.33 +reportCompare(0, 0, "ok");