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 test thoroughly checks the behaviour of the 'arguments' object. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS access_1(1, 2, 3) is 1 30 PASS access_2(1, 2, 3) is 2 31 PASS access_3(1, 2, 3) is 3 32 PASS access_4(1, 2, 3) is undefined 33 PASS access_5(1, 2, 3) is undefined 34 PASS access_1(1) is 1 35 PASS access_2(1) is undefined 36 PASS access_3(1) is undefined 37 PASS access_4(1) is undefined 38 PASS access_5(1) is undefined 39 PASS access_1(1, 2, 3, 4, 5) is 1 40 PASS access_2(1, 2, 3, 4, 5) is 2 41 PASS access_3(1, 2, 3, 4, 5) is 3 42 PASS access_4(1, 2, 3, 4, 5) is 4 43 PASS access_5(1, 2, 3, 4, 5) is 5 44 PASS argumentLengthIs5() is 5 45 PASS argumentLengthIs5(1,2,3,4,5) is 5 46 PASS argumentLengthIs5(1,2,3,4,5,6,7,8,9,10) is 5 47 PASS duplicateArgumentAndReturnLast_call(1) is 1 48 PASS duplicateArgumentAndReturnFirst_call(1) is 1 49 PASS duplicateArgumentAndReturnLast_apply(1) is 1 50 PASS duplicateArgumentAndReturnFirst_apply(1) is 1 51 PASS tear_off_equal_access_1(1, 2, 3) is 1 52 PASS tear_off_equal_access_2(1, 2, 3) is 2 53 PASS tear_off_equal_access_3(1, 2, 3) is 3 54 PASS tear_off_equal_access_4(1, 2, 3) is undefined 55 PASS tear_off_equal_access_5(1, 2, 3) is undefined 56 PASS tear_off_too_few_access_1(1) is 1 57 PASS tear_off_too_few_access_2(1) is undefined 58 PASS tear_off_too_few_access_3(1) is undefined 59 PASS tear_off_too_few_access_4(1) is undefined 60 PASS tear_off_too_few_access_5(1) is undefined 61 PASS tear_off_too_many_access_1(1, 2, 3, 4, 5) is 1 62 PASS tear_off_too_many_access_2(1, 2, 3, 4, 5) is 2 63 PASS tear_off_too_many_access_3(1, 2, 3, 4, 5) is 3 64 PASS tear_off_too_many_access_4(1, 2, 3, 4, 5) is 4 65 PASS tear_off_too_many_access_5(1, 2, 3, 4, 5) is 5 66 PASS live_1(0, 2, 3) is 1 67 PASS live_2(1, 0, 3) is 2 68 PASS live_3(1, 2, 0) is 3 69 PASS live_1(0) is 1 70 PASS live_2(1) is undefined 71 PASS live_3(1) is undefined 72 PASS live_1(0, 2, 3, 4, 5) is 1 73 PASS live_2(1, 0, 3, 4, 5) is 2 74 PASS live_3(1, 2, 0, 4, 5) is 3 75 PASS extra_args_modify_4(1, 2, 3, 0, 5) is 4 76 PASS extra_args_modify_5(1, 2, 3, 4, 0) is 5 77 PASS tear_off_live_1(0, 2, 3)() is 1 78 PASS tear_off_live_2(1, 0, 3)() is 2 79 PASS tear_off_live_3(1, 2, 0)() is 3 80 PASS tear_off_live_1(0)() is 1 81 PASS tear_off_live_2(1)() is undefined 82 PASS tear_off_live_3(1)() is undefined 83 PASS tear_off_live_1(0, 2, 3, 4, 5)() is 1 84 PASS tear_off_live_2(1, 0, 3, 4, 5)() is 2 85 PASS tear_off_live_3(1, 2, 0, 4, 5)() is 3 86 PASS tear_off_extra_args_modify_4(1, 2, 3, 0, 5)() is 4 87 PASS tear_off_extra_args_modify_5(1, 2, 3, 4, 0)() is 5 88 PASS delete_1(1, 2, 3) is undefined 89 PASS delete_2(1, 2, 3) is undefined 90 PASS delete_3(1, 2, 3) is undefined 91 PASS delete_4(1, 2, 3) is undefined 92 PASS delete_5(1, 2, 3) is undefined 93 PASS delete_1(1) is undefined 94 PASS delete_2(1) is undefined 95 PASS delete_3(1) is undefined 96 PASS delete_4(1) is undefined 97 PASS delete_5(1) is undefined 98 PASS delete_1(1, 2, 3, 4, 5) is undefined 99 PASS delete_2(1, 2, 3, 4, 5) is undefined 100 PASS delete_3(1, 2, 3, 4, 5) is undefined 101 PASS delete_4(1, 2, 3, 4, 5) is undefined 102 PASS delete_5(1, 2, 3, 4, 5) is undefined 103 PASS tear_off_delete_1(1, 2, 3)() is undefined 104 PASS tear_off_delete_2(1, 2, 3)() is undefined 105 PASS tear_off_delete_3(1, 2, 3)() is undefined 106 PASS tear_off_delete_4(1, 2, 3)() is undefined 107 PASS tear_off_delete_5(1, 2, 3)() is undefined 108 PASS tear_off_delete_1(1)() is undefined 109 PASS tear_off_delete_2(1)() is undefined 110 PASS tear_off_delete_3(1)() is undefined 111 PASS tear_off_delete_4(1)() is undefined 112 PASS tear_off_delete_5(1)() is undefined 113 PASS tear_off_delete_1(1, 2, 3, 4, 5)() is undefined 114 PASS tear_off_delete_2(1, 2, 3, 4, 5)() is undefined 115 PASS tear_off_delete_3(1, 2, 3, 4, 5)() is undefined 116 PASS tear_off_delete_4(1, 2, 3, 4, 5)() is undefined 117 PASS tear_off_delete_5(1, 2, 3, 4, 5)() is undefined 118 PASS delete_not_live_1(1, 2, 3) is 1 119 PASS delete_not_live_2(1, 2, 3) is 2 120 PASS delete_not_live_3(1, 2, 3) is 3 121 PASS delete_not_live_1(1) is 1 122 PASS delete_not_live_2(1) is undefined 123 PASS delete_not_live_3(1) is undefined 124 PASS delete_not_live_1(1, 2, 3, 4, 5) is 1 125 PASS delete_not_live_2(1, 2, 3, 4, 5) is 2 126 PASS delete_not_live_3(1, 2, 3, 4, 5) is 3 127 PASS tear_off_delete_not_live_1(1, 2, 3)() is 1 128 PASS tear_off_delete_not_live_2(1, 2, 3)() is 2 129 PASS tear_off_delete_not_live_3(1, 2, 3)() is 3 130 PASS tear_off_delete_not_live_1(1)() is 1 131 PASS tear_off_delete_not_live_2(1)() is undefined 132 PASS tear_off_delete_not_live_3(1)() is undefined 133 PASS tear_off_delete_not_live_1(1, 2, 3, 4, 5)() is 1 134 PASS tear_off_delete_not_live_2(1, 2, 3, 4, 5)() is 2 135 PASS tear_off_delete_not_live_3(1, 2, 3, 4, 5)() is 3 136 PASS access_after_delete_named_2(1, 2, 3) is 2 137 PASS access_after_delete_named_3(1, 2, 3) is 3 138 PASS access_after_delete_named_4(1, 2, 3) is undefined 139 PASS access_after_delete_named_2(1) is undefined 140 PASS access_after_delete_named_3(1) is undefined 141 PASS access_after_delete_named_4(1) is undefined 142 PASS access_after_delete_named_2(1, 2, 3, 4) is 2 143 PASS access_after_delete_named_3(1, 2, 3, 4) is 3 144 PASS access_after_delete_named_4(1, 2, 3, 4) is 4 145 PASS access_after_delete_extra_1(1, 2, 3) is 1 146 PASS access_after_delete_extra_2(1, 2, 3) is 2 147 PASS access_after_delete_extra_3(1, 2, 3) is 3 148 PASS access_after_delete_extra_5(1, 2, 3) is undefined 149 PASS access_after_delete_extra_1(1) is 1 150 PASS access_after_delete_extra_2(1) is undefined 151 PASS access_after_delete_extra_3(1) is undefined 152 PASS access_after_delete_extra_5(1) is undefined 153 PASS access_after_delete_extra_1(1, 2, 3, 4, 5) is 1 154 PASS access_after_delete_extra_2(1, 2, 3, 4, 5) is 2 155 PASS access_after_delete_extra_3(1, 2, 3, 4, 5) is 3 156 PASS access_after_delete_extra_5(1, 2, 3, 4, 5) is 5 157 PASS argumentsParam(true) is true 158 PASS argumentsFunctionConstructorParam(true) is true 159 PASS argumentsVarUndefined() is '[object Arguments]' 160 FAIL argumentsConstUndefined() should be [object Arguments]. Threw exception TypeError: Identifier 'arguments' has already been declared 161 PASS argumentCalleeInException() is argumentCalleeInException 162 PASS shadowedArgumentsApply([true]) is true 163 PASS shadowedArgumentsLength([]) is 0 164 PASS shadowedArgumentsLength() threw exception TypeError: Cannot read property 'length' of undefined. 165 PASS shadowedArgumentsCallee([]) is undefined. 166 PASS shadowedArgumentsIndex([true]) is true 167 PASS descriptor.value is "one" 168 PASS descriptor.writable is true 169 PASS descriptor.enumerable is true 170 PASS descriptor.configurable is true 171 PASS true is true 172 PASS true is true 173 PASS true is true 174 PASS true is true 175 PASS true is true 176 PASS true is true 177 PASS true is true 178 PASS true is true 179 PASS true is true 180 PASS true is true 181 PASS true is true 182 PASS true is true 183 PASS true is true 184 PASS true is true 185 PASS true is true 186 PASS true is true 187 PASS true is true 188 PASS true is true 189 PASS true is true 190 PASS true is true 191 PASS true is true 192 PASS true is true 193 PASS true is true 194 PASS true is true 195 PASS true is true 196 PASS true is true 197 PASS false is false 198 PASS true is true 199 PASS false is false 200 PASS false is false 201 PASS undefined is undefined. 202 PASS true is true 203 PASS false is false 204 PASS successfullyParsed is true 205 206 TEST COMPLETE 207 208