1fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// Copyright 2013 the V8 project authors. All rights reserved.
2fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org//
4fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// Redistribution and use in source and binary forms, with or without
5fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// modification, are permitted provided that the following conditions
6fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// are met:
7fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// 1.  Redistributions of source code must retain the above copyright
8fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org//     notice, this list of conditions and the following disclaimer.
9fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// 2.  Redistributions in binary form must reproduce the above copyright
10fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org//     notice, this list of conditions and the following disclaimer in the
11fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org//     documentation and/or other materials provided with the distribution.
12fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org//
13fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org
24fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgdescription(
25fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org"This page tests for length miscalculations in regular expression processing."
26fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org);
27fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org
28fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar re = /b|[^b]/g;
29fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgre.lastIndex = 1;
30fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("re.exec('a')", "null");
31fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org
32fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgvar re2 = /[^a]|ab/;
33fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("re2.test('')", "false");
34