11510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org// Copyright 2013 the V8 project authors. All rights reserved. 2a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// Redistribution and use in source and binary forms, with or without 3a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// modification, are permitted provided that the following conditions are 4a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// met: 5a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// 6a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// * Redistributions of source code must retain the above copyright 7a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// notice, this list of conditions and the following disclaimer. 8a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// * Redistributions in binary form must reproduce the above 9a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// copyright notice, this list of conditions and the following 10a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// disclaimer in the documentation and/or other materials provided 11a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// with the distribution. 12a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// * Neither the name of Google Inc. nor the names of its 13a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// contributors may be used to endorse or promote products derived 14a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// from this software without specific prior written permission. 15a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// 16a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org 281510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org// Test that String.prototype.split with an regexp does not call the 291510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org// monkey-patchable Array.prototype.push or PutValue. 30a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org 311510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.orgArray.prototype.push = assertUnreachable; 32a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org 331510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.orgObject.defineProperty(Array.prototype, "0", { 341510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org get: assertUnreachable, 351510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org set: assertUnreachable }); 36a55512615f5adc085d23bc8589d155c4b579fb7bkasperl@chromium.org 371510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org"-".split(/-/); 381510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org"I-must-not-use-push!".split(/-/); 391510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org"Oh-no!".split(/(-)/); 401510d58cbcf57c82a10e7d390bfe21a7ae68ba43mstarzinger@chromium.org"a".split(/(a)|(b)/); 41