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'Test that covers capturing brackets, and was adapted from a part of an early version of Acid3.' 26fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org); 27fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org 28fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// JS regexps aren't like Perl regexps, if their character 29fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// classes start with a ] that means they're empty. So this 30fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.org// is a syntax error; if we get here it's a bug. 31fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldThrow("/TA[])]/.exec('TA]')"); 32fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("/[]/.exec('')", "null"); 33fb732b17922ea75830be4db6b80534c4827d8a55jkummerow@chromium.orgshouldBe("/(\\3)(\\1)(a)/.exec('cat').toString()", "'a,,,a'"); 34