1# Copyright 2013 the V8 project authors. All rights reserved. 2# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3# 4# Redistribution and use in source and binary forms, with or without 5# modification, are permitted provided that the following conditions 6# are met: 7# 1. Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# 2. Redistributions in binary form must reproduce the above copyright 10# notice, this list of conditions and the following disclaimer in the 11# documentation and/or other materials provided with the distribution. 12# 13# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24Tests that we do ToString conversions correctly when String.prototype.valueOf is not what we wanted. 25 26On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29hello 30PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 31hello 32PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 33hello 34PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 35hello 36PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 37hello 38PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 39hello 40PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 41hello 42PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 43hello 44PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 45hello 46PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 47hello 48PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 49hello 50PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 51hello 52PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 53hello 54PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 55hello 56PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 57hello 58PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 59hello 60PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 61hello 62PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 63hello 64PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 65hello 66PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 67hello 68PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 69hello 70PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 71hello 72PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 73hello 74PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 75hello 76PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 77hello 78PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 79hello 80PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 81hello 82PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 83hello 84PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 85hello 86PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 87hello 88PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 89hello 90PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 91hello 92PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 93hello 94PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 95hello 96PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 97hello 98PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 99hello 100PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 101hello 102PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 103hello 104PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 105hello 106PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 107hello 108PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 109hello 110PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 111hello 112PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 113hello 114PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 115hello 116PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 117hello 118PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 119hello 120PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 121hello 122PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 123hello 124PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 125hello 126PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 127hello 128PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 129hello 130PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 131hello 132PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 133hello 134PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 135hello 136PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 137hello 138PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 139hello 140PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 141hello 142PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 143hello 144PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 145hello 146PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 147hello 148PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 149hello 150PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 151hello 152PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 153hello 154PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 155hello 156PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 157hello 158PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 159hello 160PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 161hello 162PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 163hello 164PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 165hello 166PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 167hello 168PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 169hello 170PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 171hello 172PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 173hello 174PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 175hello 176PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 177hello 178PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 179hello 180PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 181hello 182PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 183hello 184PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 185hello 186PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 187hello 188PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 189hello 190PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 191hello 192PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 193hello 194PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 195hello 196PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 197hello 198PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 199hello 200PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 201hello 202PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 203hello 204PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 205hello 206PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 207hello 208PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 209hello 210PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 211hello 212PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 213hello 214PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 215hello 216PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 217hello 218PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 219hello 220PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 221hello 222PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 223hello 224PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 225hello 226PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 227hello 228PASS "" + foo({toString:function() { debug("hello"); return 42; }}) is "42" 229PASS successfullyParsed is true 230 231TEST COMPLETE 232 233