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 24 This is a test of the charAt and charCodeAt string functions. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS "".charAt() is "" 30 PASS "".charCodeAt() is NaN 31 PASS "".charAt(undefined) is "" 32 PASS "".charCodeAt(undefined) is NaN 33 PASS "".charAt(0) is "" 34 PASS "".charCodeAt(0) is NaN 35 PASS "".charAt(null) is "" 36 PASS "".charCodeAt(null) is NaN 37 PASS "".charAt(false) is "" 38 PASS "".charCodeAt(false) is NaN 39 PASS "".charAt(true) is "" 40 PASS "".charCodeAt(true) is NaN 41 PASS "".charAt(0) is "" 42 PASS "".charCodeAt(0) is NaN 43 PASS "".charAt(0.1) is "" 44 PASS "".charCodeAt(0.1) is NaN 45 PASS "".charAt(999) is "" 46 PASS "".charCodeAt(999) is NaN 47 PASS "".charAt(Infinity) is "" 48 PASS "".charCodeAt(Infinity) is NaN 49 PASS "".charAt(-1) is "" 50 PASS "".charCodeAt(-1) is NaN 51 PASS "".charAt(-Infinity) is "" 52 PASS "".charCodeAt(-Infinity) is NaN 53 PASS "".charAt(NaN) is "" 54 PASS "".charCodeAt(NaN) is NaN 55 PASS "x".charAt() is "x" 56 PASS "x".charCodeAt() is 120 57 PASS "x".charAt(undefined) is "x" 58 PASS "x".charCodeAt(undefined) is 120 59 PASS "x".charAt(0) is "x" 60 PASS "x".charCodeAt(0) is 120 61 PASS "x".charAt(null) is "x" 62 PASS "x".charCodeAt(null) is 120 63 PASS "x".charAt(false) is "x" 64 PASS "x".charCodeAt(false) is 120 65 PASS "x".charAt(true) is "" 66 PASS "x".charCodeAt(true) is NaN 67 PASS "x".charAt(0) is "x" 68 PASS "x".charCodeAt(0) is 120 69 PASS "x".charAt(0.1) is "x" 70 PASS "x".charCodeAt(0.1) is 120 71 PASS "x".charAt(999) is "" 72 PASS "x".charCodeAt(999) is NaN 73 PASS "x".charAt(Infinity) is "" 74 PASS "x".charCodeAt(Infinity) is NaN 75 PASS "x".charAt(-1) is "" 76 PASS "x".charCodeAt(-1) is NaN 77 PASS "x".charAt(-Infinity) is "" 78 PASS "x".charCodeAt(-Infinity) is NaN 79 PASS "x".charAt(NaN) is "x" 80 PASS "x".charCodeAt(NaN) is 120 81 PASS "xy".charAt() is "x" 82 PASS "xy".charCodeAt() is 120 83 PASS "xy".charAt(undefined) is "x" 84 PASS "xy".charCodeAt(undefined) is 120 85 PASS "xy".charAt(0) is "x" 86 PASS "xy".charCodeAt(0) is 120 87 PASS "xy".charAt(null) is "x" 88 PASS "xy".charCodeAt(null) is 120 89 PASS "xy".charAt(false) is "x" 90 PASS "xy".charCodeAt(false) is 120 91 PASS "xy".charAt(true) is "y" 92 PASS "xy".charCodeAt(true) is 121 93 PASS "xy".charAt(0) is "x" 94 PASS "xy".charCodeAt(0) is 120 95 PASS "xy".charAt(0.1) is "x" 96 PASS "xy".charCodeAt(0.1) is 120 97 PASS "xy".charAt(999) is "" 98 PASS "xy".charCodeAt(999) is NaN 99 PASS "xy".charAt(Infinity) is "" 100 PASS "xy".charCodeAt(Infinity) is NaN 101 PASS "xy".charAt(-1) is "" 102 PASS "xy".charCodeAt(-1) is NaN 103 PASS "xy".charAt(-Infinity) is "" 104 PASS "xy".charCodeAt(-Infinity) is NaN 105 PASS "xy".charAt(NaN) is "x" 106 PASS "xy".charCodeAt(NaN) is 120 107 PASS successfullyParsed is true 108 109 TEST COMPLETE 110 111