15d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// Copyright 2010 the V8 project authors. All rights reserved. 25d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// Redistribution and use in source and binary forms, with or without 35d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// modification, are permitted provided that the following conditions are 45d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// met: 55d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// 65d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// * Redistributions of source code must retain the above copyright 75d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// notice, this list of conditions and the following disclaimer. 85d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// * Redistributions in binary form must reproduce the above 95d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// copyright notice, this list of conditions and the following 105d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// disclaimer in the documentation and/or other materials provided 115d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// with the distribution. 125d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// * Neither the name of Google Inc. nor the names of its 135d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// contributors may be used to endorse or promote products derived 145d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// from this software without specific prior written permission. 155d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// 165d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 175d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 185d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 195d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 205d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 215d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 225d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 235d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 245d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 255d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 265d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 275d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org 285d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// See: http://code.google.com/p/v8/issues/detail?id=1017 295d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org 305d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// 32 ASCII-characters followed by a non-ASCII character. 315d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// This causes an internal buffer to first expand to 64 bytes, then expand the 325d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// 32 ASCII characters to 64 bytes of UC16 characters, leaving no room 335d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org// to store the 33rd character. This fails an ASSERT in debug mode. 345d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.org 355d00b60c201d860c74821f553fdc34f4e057b411lrn@chromium.orgassertEquals(33, "12345678901234567890123456789012\u2028".length); 36