1a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// Copyright 2009 the V8 project authors. All rights reserved. 2a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// Redistribution and use in source and binary forms, with or without 3a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// modification, are permitted provided that the following conditions are 4a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// met: 5a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// 6a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// * Redistributions of source code must retain the above copyright 7a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// notice, this list of conditions and the following disclaimer. 8a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// * Redistributions in binary form must reproduce the above 9a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// copyright notice, this list of conditions and the following 10a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// disclaimer in the documentation and/or other materials provided 11a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// with the distribution. 12a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// * Neither the name of Google Inc. nor the names of its 13a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// contributors may be used to endorse or promote products derived 14a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// from this software without specific prior written permission. 15a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// 16a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org 28a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org// See http://crbug.com/18639 29a1645e29968e70a41226edda2c49788fcea48b74ager@chromium.org 30cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.orgtry { 31cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org toString = toString; 32cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org __defineGetter__("z", (0).toLocaleString); 33cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org z; 34cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org z; 35cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org ((0).toLocaleString)(); 36cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org} catch (e) { 37cddc71f18a46e6117cc765b1c53ca122e7aaa318rossberg@chromium.org assertInstanceof(e, TypeError); 38f9841897146bc10dbb3c45f0632bb79254602c75machenbach@chromium.org} 39