v8/test/webkit/fast/js/regexp-stack-overflow.js

35 lines
98 KiB
JavaScript
Raw Normal View History

// Copyright 2013 the V8 project authors. All rights reserved.
// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
'Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=8870">bug 8870</a>: Crash typing in Yahoo auto-complete widget.'
);
re = new RegExp('^(\\s+|[,:{}\\[\\]]|"(\\\\["\\\\\\/bfnrtu]|[^\\x00-\\x1f"\\\\]+)*"|-?\\d+(\\.\\d*)?([eE][+-]?\\d+)?|true|false|null)+$', '');
result= re.exec('{"ResultSet":{"totalResultsAvailable":"101000000","totalResultsReturned":100,"firstResultPosition":1,"Result":[{"Title":"Solar Eclipses of Saros 132","Summary":"Solar Eclipses of Saros 132 Solar Eclipses of Saros 132 The periodicity and recurrence of solar (and lunar) eclipses is governed by the Saros cycle, a period of approximately 6,585. 3 days (18 years 11 days 8 hours). When two eclipses are ...","Url":"http:\\/\\/sunearth.gsfc.nasa.gov\\/eclipse\\/SEsaros\\/SEsaros132.html","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBUBzdmMwF;_ylu=X3oDMTB2cXVjNTM5BGNvbG8DdwRsA1dTMQRwb3MDMQRzZWMDc3IEdnRpZAM-\\/SIG=19ip3vo9u\\/EXP=1147592336\\/**http%3a\\/\\/rdrw1.yahoo.com\\/click%3fu=http%3a\\/\\/sunearth.gsfc.nasa.gov\\/eclipse\\/SEsaros\\/SEsaros132.html%26y=0405DC60F30D6DD673%26i=482%26c=15685%26q=02%255ESSHPM%255BL7.,-6%26e=utf-8%26r=0%26d=wow%7eWBSV-en-us%26n=3O6KG7JU5PIK8T7I%26s=6%26t=%26m=44658D10%26x=05A6B5FDC2F29725CD6EE467684E0FE76D","ModificationDate":1146207600,"MimeType":"text\\/html"},{"Title":"Psalms 132 -Matthew Henry\'s Commentary - Bible Software by johnhurt.com","Summary":"Psalms 132 - Matthew Henry Commentary - Bible Software by johnhurt.com ... Henry\'s Psalms 131. Psalms 132. Outline of Psalms 132. David\'s care for the ark ...","Url":"http:\\/\\/www.htmlbible.com\\/kjv30\\/henry\\/H19C132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBVhzdmMwF;_ylu=X3oDMTB2ZjQ4dDExBGNvbG8DdwRsA1dTMQRwb3MDMgRzZWMDc3IEdnRpZAM-\\/SIG=1246fjpfq\\/EXP=1147592336\\/**http%3a\\/\\/www.htmlbible.com\\/kjv30\\/henry\\/H19C132.htm","ModificationDate":1015660800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBWxzdmMwF;_ylu=X3oDMTBwZG5hOWwzBGNvbG8DdwRwb3MDMgRzZWMDc3IEdnRpZAM-\\/SIG=16llm3b1a\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.htmlbible.com\\/kjv30\\/henry\\/H19C132.htm%26w=132%26d=XlIIG0aqMlsm%26icp=1%26.intl=us","Size":"4160"}},{"Title":"General requirements. - 1910.132","Summary":"General%20requirements.%20-%201910.132 ... Regulations (Standards - 29 CFR) General requirements. - 1910.132 ... of any part of the body through absorption, inhalation or physical contact. 1910.132(b) Employee-owned equipment ...","Url":"http:\\/\\/www.osha.gov\\/pls\\/oshaweb\\/owadisp.show_document?p_table=STANDARDS&p_id=9777","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBXRzdmMwF;_ylu=X3oDMTB2M3MzdmZoBGNvbG8DdwRsA1dTMQRwb3MDMwRzZWMDc3IEdnRpZAM-\\/SIG=13916ebti\\/EXP=1147592336\\/**http%3a\\/\\/www.osha.gov\\/pls\\/oshaweb\\/owadisp.show_document%3fp_table=STANDARDS%26p_id=9777","ModificationDate":1147330800,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBYhzdmMwF;_ylu=X3oDMTBwZ2dpZ2ZkBGNvbG8DdwRwb3MDMwRzZWMDc3IEdnRpZAM-\\/SIG=186osem1n\\/EXP=1147592336\\/**http%3a\\/\\/66.218.69.11\\/search\\/cache%3fei=UTF-8%26query=132%26output=json%26results=100%26appid=jennyhan_ac%26u=www.osha.gov\\/pls\\/oshaweb\\/owadisp.show_document%253Fp_table%253DSTANDARDS%2526p_id%253D9777%26w=132%26d=Ujn5sEaqMw88%26icp=1%26.intl=us","Size":"29922"}},{"Title":"USCCB - NAB - Psalm 132","Summary":"Chapter 132. 1. 1 A song of ascents. 2 LORD, remember David and all his anxious care; 2. 3 How he swore an oath to the LORD, vowed to the Mighty One of Jacob: 3. \\"I will not enter the house where I live, nor lie on the couch where I sleep; ... 1 [Psalm 132] A song for a liturgical ceremony in which the ark, the throne of Israel\'s God, was carried in ...","Url":"http:\\/\\/www.usccb.org\\/nab\\/bible\\/psalms\\/psalm132.htm","ClickUrl":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBZBzdmMwF;_ylu=X3oDMTB2OWM1MXQ5BGNvbG8DdwRsA1dTMQRwb3MDNARzZWMDc3IEdnRpZAM-\\/SIG=126n03p75\\/EXP=1147592336\\/**http%3a\\/\\/www.usccb.org\\/nab\\/bible\\/psalms\\/psalm132.htm","ModificationDate":1054623600,"MimeType":"text\\/html","Cache":{"Url":"http:\\/\\/uk.wrs.yahoo.com\\/_ylt=A0Je5VwQjWVEsGcBaRzdmMwF;_ylu=X3oDMTBwYzFnNmkxBGNvbG8Dd
shouldBe("result.length", "5");