17ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// Copyright 2011 the V8 project authors. All rights reserved. 27ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// Redistribution and use in source and binary forms, with or without 37ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// modification, are permitted provided that the following conditions are 47ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// met: 57ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// 67ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// * Redistributions of source code must retain the above copyright 77ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// notice, this list of conditions and the following disclaimer. 87ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// * Redistributions in binary form must reproduce the above 97ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// copyright notice, this list of conditions and the following 107ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// disclaimer in the documentation and/or other materials provided 117ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// with the distribution. 127ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// * Neither the name of Google Inc. nor the names of its 137ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// contributors may be used to endorse or promote products derived 147ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// from this software without specific prior written permission. 157ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// 167ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 177ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 187ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 197ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 207ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 217ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 227ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 237ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 247ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 257ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 267ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 277ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org 287ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org// This used to trigger a crash because of an unhandled stack overflow. 297ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.orgfunction setx() { 307ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org setx(typeof new Uint16Array('x') === 'object'); 317ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org} 327ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.orgvar exception = false; 337ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.orgtry { 347ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org setx(); 357ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org} catch (ex) { 367ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org assertTrue(ex instanceof RangeError); 377ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org exception = true; 387ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.org} 397ad65226b3ba6f9250a5ee869ee77e2b9258fc91ricow@chromium.orgassertTrue(exception); 40