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 checks that parentheses are preserved when significant, and not added where inappropriate. We need this test because the JavaScriptCore parser removes all parentheses and the serializer then adds them back. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS compileAndSerialize('a * b * c') is 'a * b * c' 30 PASS compileAndSerialize('(a * b) * c') is '(a * b) * c' 31 PASS compileAndSerialize('a * (b * c)') is 'a * (b * c)' 32 PASS compileAndSerialize('a * b + c') is 'a * b + c' 33 PASS compileAndSerialize('(a * b) + c') is '(a * b) + c' 34 PASS compileAndSerialize('a * (b + c)') is 'a * (b + c)' 35 PASS compileAndSerialize('a * b - c') is 'a * b - c' 36 PASS compileAndSerialize('(a * b) - c') is '(a * b) - c' 37 PASS compileAndSerialize('a * (b - c)') is 'a * (b - c)' 38 PASS compileAndSerialize('a / b / c') is 'a / b / c' 39 PASS compileAndSerialize('(a / b) / c') is '(a / b) / c' 40 PASS compileAndSerialize('a / (b / c)') is 'a / (b / c)' 41 PASS compileAndSerialize('a * b / c') is 'a * b / c' 42 PASS compileAndSerialize('(a * b) / c') is '(a * b) / c' 43 PASS compileAndSerialize('a * (b / c)') is 'a * (b / c)' 44 PASS compileAndSerialize('a / b + c') is 'a / b + c' 45 PASS compileAndSerialize('(a / b) + c') is '(a / b) + c' 46 PASS compileAndSerialize('a / (b + c)') is 'a / (b + c)' 47 PASS compileAndSerialize('a % b % c') is 'a % b % c' 48 PASS compileAndSerialize('(a % b) % c') is '(a % b) % c' 49 PASS compileAndSerialize('a % (b % c)') is 'a % (b % c)' 50 PASS compileAndSerialize('a * b % c') is 'a * b % c' 51 PASS compileAndSerialize('(a * b) % c') is '(a * b) % c' 52 PASS compileAndSerialize('a * (b % c)') is 'a * (b % c)' 53 PASS compileAndSerialize('a % b + c') is 'a % b + c' 54 PASS compileAndSerialize('(a % b) + c') is '(a % b) + c' 55 PASS compileAndSerialize('a % (b + c)') is 'a % (b + c)' 56 PASS compileAndSerialize('a + b + c') is 'a + b + c' 57 PASS compileAndSerialize('(a + b) + c') is '(a + b) + c' 58 PASS compileAndSerialize('a + (b + c)') is 'a + (b + c)' 59 PASS compileAndSerialize('a + b << c') is 'a + b << c' 60 PASS compileAndSerialize('(a + b) << c') is '(a + b) << c' 61 PASS compileAndSerialize('a + (b << c)') is 'a + (b << c)' 62 PASS compileAndSerialize('a + b >> c') is 'a + b >> c' 63 PASS compileAndSerialize('(a + b) >> c') is '(a + b) >> c' 64 PASS compileAndSerialize('a + (b >> c)') is 'a + (b >> c)' 65 PASS compileAndSerialize('a + b >>> c') is 'a + b >>> c' 66 PASS compileAndSerialize('(a + b) >>> c') is '(a + b) >>> c' 67 PASS compileAndSerialize('a + (b >>> c)') is 'a + (b >>> c)' 68 PASS compileAndSerialize('a - b - c') is 'a - b - c' 69 PASS compileAndSerialize('(a - b) - c') is '(a - b) - c' 70 PASS compileAndSerialize('a - (b - c)') is 'a - (b - c)' 71 PASS compileAndSerialize('a + b - c') is 'a + b - c' 72 PASS compileAndSerialize('(a + b) - c') is '(a + b) - c' 73 PASS compileAndSerialize('a + (b - c)') is 'a + (b - c)' 74 PASS compileAndSerialize('a - b << c') is 'a - b << c' 75 PASS compileAndSerialize('(a - b) << c') is '(a - b) << c' 76 PASS compileAndSerialize('a - (b << c)') is 'a - (b << c)' 77 PASS compileAndSerialize('a << b << c') is 'a << b << c' 78 PASS compileAndSerialize('(a << b) << c') is '(a << b) << c' 79 PASS compileAndSerialize('a << (b << c)') is 'a << (b << c)' 80 PASS compileAndSerialize('a << b < c') is 'a << b < c' 81 PASS compileAndSerialize('(a << b) < c') is '(a << b) < c' 82 PASS compileAndSerialize('a << (b < c)') is 'a << (b < c)' 83 PASS compileAndSerialize('a << b > c') is 'a << b > c' 84 PASS compileAndSerialize('(a << b) > c') is '(a << b) > c' 85 PASS compileAndSerialize('a << (b > c)') is 'a << (b > c)' 86 PASS compileAndSerialize('a << b <= c') is 'a << b <= c' 87 PASS compileAndSerialize('(a << b) <= c') is '(a << b) <= c' 88 PASS compileAndSerialize('a << (b <= c)') is 'a << (b <= c)' 89 PASS compileAndSerialize('a << b >= c') is 'a << b >= c' 90 PASS compileAndSerialize('(a << b) >= c') is '(a << b) >= c' 91 PASS compileAndSerialize('a << (b >= c)') is 'a << (b >= c)' 92 PASS compileAndSerialize('a << b instanceof c') is 'a << b instanceof c' 93 PASS compileAndSerialize('(a << b) instanceof c') is '(a << b) instanceof c' 94 PASS compileAndSerialize('a << (b instanceof c)') is 'a << (b instanceof c)' 95 PASS compileAndSerialize('a << b in c') is 'a << b in c' 96 PASS compileAndSerialize('(a << b) in c') is '(a << b) in c' 97 PASS compileAndSerialize('a << (b in c)') is 'a << (b in c)' 98 PASS compileAndSerialize('a >> b >> c') is 'a >> b >> c' 99 PASS compileAndSerialize('(a >> b) >> c') is '(a >> b) >> c' 100 PASS compileAndSerialize('a >> (b >> c)') is 'a >> (b >> c)' 101 PASS compileAndSerialize('a << b >> c') is 'a << b >> c' 102 PASS compileAndSerialize('(a << b) >> c') is '(a << b) >> c' 103 PASS compileAndSerialize('a << (b >> c)') is 'a << (b >> c)' 104 PASS compileAndSerialize('a >> b < c') is 'a >> b < c' 105 PASS compileAndSerialize('(a >> b) < c') is '(a >> b) < c' 106 PASS compileAndSerialize('a >> (b < c)') is 'a >> (b < c)' 107 PASS compileAndSerialize('a >>> b >>> c') is 'a >>> b >>> c' 108 PASS compileAndSerialize('(a >>> b) >>> c') is '(a >>> b) >>> c' 109 PASS compileAndSerialize('a >>> (b >>> c)') is 'a >>> (b >>> c)' 110 PASS compileAndSerialize('a << b >>> c') is 'a << b >>> c' 111 PASS compileAndSerialize('(a << b) >>> c') is '(a << b) >>> c' 112 PASS compileAndSerialize('a << (b >>> c)') is 'a << (b >>> c)' 113 PASS compileAndSerialize('a >>> b < c') is 'a >>> b < c' 114 PASS compileAndSerialize('(a >>> b) < c') is '(a >>> b) < c' 115 PASS compileAndSerialize('a >>> (b < c)') is 'a >>> (b < c)' 116 PASS compileAndSerialize('a < b < c') is 'a < b < c' 117 PASS compileAndSerialize('(a < b) < c') is '(a < b) < c' 118 PASS compileAndSerialize('a < (b < c)') is 'a < (b < c)' 119 PASS compileAndSerialize('a < b == c') is 'a < b == c' 120 PASS compileAndSerialize('(a < b) == c') is '(a < b) == c' 121 PASS compileAndSerialize('a < (b == c)') is 'a < (b == c)' 122 PASS compileAndSerialize('a < b != c') is 'a < b != c' 123 PASS compileAndSerialize('(a < b) != c') is '(a < b) != c' 124 PASS compileAndSerialize('a < (b != c)') is 'a < (b != c)' 125 PASS compileAndSerialize('a < b === c') is 'a < b === c' 126 PASS compileAndSerialize('(a < b) === c') is '(a < b) === c' 127 PASS compileAndSerialize('a < (b === c)') is 'a < (b === c)' 128 PASS compileAndSerialize('a < b !== c') is 'a < b !== c' 129 PASS compileAndSerialize('(a < b) !== c') is '(a < b) !== c' 130 PASS compileAndSerialize('a < (b !== c)') is 'a < (b !== c)' 131 PASS compileAndSerialize('a > b > c') is 'a > b > c' 132 PASS compileAndSerialize('(a > b) > c') is '(a > b) > c' 133 PASS compileAndSerialize('a > (b > c)') is 'a > (b > c)' 134 PASS compileAndSerialize('a < b > c') is 'a < b > c' 135 PASS compileAndSerialize('(a < b) > c') is '(a < b) > c' 136 PASS compileAndSerialize('a < (b > c)') is 'a < (b > c)' 137 PASS compileAndSerialize('a > b == c') is 'a > b == c' 138 PASS compileAndSerialize('(a > b) == c') is '(a > b) == c' 139 PASS compileAndSerialize('a > (b == c)') is 'a > (b == c)' 140 PASS compileAndSerialize('a <= b <= c') is 'a <= b <= c' 141 PASS compileAndSerialize('(a <= b) <= c') is '(a <= b) <= c' 142 PASS compileAndSerialize('a <= (b <= c)') is 'a <= (b <= c)' 143 PASS compileAndSerialize('a < b <= c') is 'a < b <= c' 144 PASS compileAndSerialize('(a < b) <= c') is '(a < b) <= c' 145 PASS compileAndSerialize('a < (b <= c)') is 'a < (b <= c)' 146 PASS compileAndSerialize('a <= b == c') is 'a <= b == c' 147 PASS compileAndSerialize('(a <= b) == c') is '(a <= b) == c' 148 PASS compileAndSerialize('a <= (b == c)') is 'a <= (b == c)' 149 PASS compileAndSerialize('a >= b >= c') is 'a >= b >= c' 150 PASS compileAndSerialize('(a >= b) >= c') is '(a >= b) >= c' 151 PASS compileAndSerialize('a >= (b >= c)') is 'a >= (b >= c)' 152 PASS compileAndSerialize('a < b >= c') is 'a < b >= c' 153 PASS compileAndSerialize('(a < b) >= c') is '(a < b) >= c' 154 PASS compileAndSerialize('a < (b >= c)') is 'a < (b >= c)' 155 PASS compileAndSerialize('a >= b == c') is 'a >= b == c' 156 PASS compileAndSerialize('(a >= b) == c') is '(a >= b) == c' 157 PASS compileAndSerialize('a >= (b == c)') is 'a >= (b == c)' 158 PASS compileAndSerialize('a instanceof b instanceof c') is 'a instanceof b instanceof c' 159 PASS compileAndSerialize('(a instanceof b) instanceof c') is '(a instanceof b) instanceof c' 160 PASS compileAndSerialize('a instanceof (b instanceof c)') is 'a instanceof (b instanceof c)' 161 PASS compileAndSerialize('a < b instanceof c') is 'a < b instanceof c' 162 PASS compileAndSerialize('(a < b) instanceof c') is '(a < b) instanceof c' 163 PASS compileAndSerialize('a < (b instanceof c)') is 'a < (b instanceof c)' 164 PASS compileAndSerialize('a instanceof b == c') is 'a instanceof b == c' 165 PASS compileAndSerialize('(a instanceof b) == c') is '(a instanceof b) == c' 166 PASS compileAndSerialize('a instanceof (b == c)') is 'a instanceof (b == c)' 167 PASS compileAndSerialize('a in b in c') is 'a in b in c' 168 PASS compileAndSerialize('(a in b) in c') is '(a in b) in c' 169 PASS compileAndSerialize('a in (b in c)') is 'a in (b in c)' 170 PASS compileAndSerialize('a < b in c') is 'a < b in c' 171 PASS compileAndSerialize('(a < b) in c') is '(a < b) in c' 172 PASS compileAndSerialize('a < (b in c)') is 'a < (b in c)' 173 PASS compileAndSerialize('a in b == c') is 'a in b == c' 174 PASS compileAndSerialize('(a in b) == c') is '(a in b) == c' 175 PASS compileAndSerialize('a in (b == c)') is 'a in (b == c)' 176 PASS compileAndSerialize('a == b == c') is 'a == b == c' 177 PASS compileAndSerialize('(a == b) == c') is '(a == b) == c' 178 PASS compileAndSerialize('a == (b == c)') is 'a == (b == c)' 179 PASS compileAndSerialize('a == b & c') is 'a == b & c' 180 PASS compileAndSerialize('(a == b) & c') is '(a == b) & c' 181 PASS compileAndSerialize('a == (b & c)') is 'a == (b & c)' 182 PASS compileAndSerialize('a != b != c') is 'a != b != c' 183 PASS compileAndSerialize('(a != b) != c') is '(a != b) != c' 184 PASS compileAndSerialize('a != (b != c)') is 'a != (b != c)' 185 PASS compileAndSerialize('a == b != c') is 'a == b != c' 186 PASS compileAndSerialize('(a == b) != c') is '(a == b) != c' 187 PASS compileAndSerialize('a == (b != c)') is 'a == (b != c)' 188 PASS compileAndSerialize('a != b & c') is 'a != b & c' 189 PASS compileAndSerialize('(a != b) & c') is '(a != b) & c' 190 PASS compileAndSerialize('a != (b & c)') is 'a != (b & c)' 191 PASS compileAndSerialize('a === b === c') is 'a === b === c' 192 PASS compileAndSerialize('(a === b) === c') is '(a === b) === c' 193 PASS compileAndSerialize('a === (b === c)') is 'a === (b === c)' 194 PASS compileAndSerialize('a == b === c') is 'a == b === c' 195 PASS compileAndSerialize('(a == b) === c') is '(a == b) === c' 196 PASS compileAndSerialize('a == (b === c)') is 'a == (b === c)' 197 PASS compileAndSerialize('a === b & c') is 'a === b & c' 198 PASS compileAndSerialize('(a === b) & c') is '(a === b) & c' 199 PASS compileAndSerialize('a === (b & c)') is 'a === (b & c)' 200 PASS compileAndSerialize('a !== b !== c') is 'a !== b !== c' 201 PASS compileAndSerialize('(a !== b) !== c') is '(a !== b) !== c' 202 PASS compileAndSerialize('a !== (b !== c)') is 'a !== (b !== c)' 203 PASS compileAndSerialize('a == b !== c') is 'a == b !== c' 204 PASS compileAndSerialize('(a == b) !== c') is '(a == b) !== c' 205 PASS compileAndSerialize('a == (b !== c)') is 'a == (b !== c)' 206 PASS compileAndSerialize('a !== b & c') is 'a !== b & c' 207 PASS compileAndSerialize('(a !== b) & c') is '(a !== b) & c' 208 PASS compileAndSerialize('a !== (b & c)') is 'a !== (b & c)' 209 PASS compileAndSerialize('a & b & c') is 'a & b & c' 210 PASS compileAndSerialize('(a & b) & c') is '(a & b) & c' 211 PASS compileAndSerialize('a & (b & c)') is 'a & (b & c)' 212 PASS compileAndSerialize('a & b ^ c') is 'a & b ^ c' 213 PASS compileAndSerialize('(a & b) ^ c') is '(a & b) ^ c' 214 PASS compileAndSerialize('a & (b ^ c)') is 'a & (b ^ c)' 215 PASS compileAndSerialize('a ^ b ^ c') is 'a ^ b ^ c' 216 PASS compileAndSerialize('(a ^ b) ^ c') is '(a ^ b) ^ c' 217 PASS compileAndSerialize('a ^ (b ^ c)') is 'a ^ (b ^ c)' 218 PASS compileAndSerialize('a ^ b | c') is 'a ^ b | c' 219 PASS compileAndSerialize('(a ^ b) | c') is '(a ^ b) | c' 220 PASS compileAndSerialize('a ^ (b | c)') is 'a ^ (b | c)' 221 PASS compileAndSerialize('a | b | c') is 'a | b | c' 222 PASS compileAndSerialize('(a | b) | c') is '(a | b) | c' 223 PASS compileAndSerialize('a | (b | c)') is 'a | (b | c)' 224 PASS compileAndSerialize('a | b && c') is 'a | b && c' 225 PASS compileAndSerialize('(a | b) && c') is '(a | b) && c' 226 PASS compileAndSerialize('a | (b && c)') is 'a | (b && c)' 227 PASS compileAndSerialize('a && b && c') is 'a && b && c' 228 PASS compileAndSerialize('(a && b) && c') is '(a && b) && c' 229 PASS compileAndSerialize('a && (b && c)') is 'a && (b && c)' 230 PASS compileAndSerialize('a && b || c') is 'a && b || c' 231 PASS compileAndSerialize('(a && b) || c') is '(a && b) || c' 232 PASS compileAndSerialize('a && (b || c)') is 'a && (b || c)' 233 PASS compileAndSerialize('a || b || c') is 'a || b || c' 234 PASS compileAndSerialize('(a || b) || c') is '(a || b) || c' 235 PASS compileAndSerialize('a || (b || c)') is 'a || (b || c)' 236 PASS compileAndSerialize('a = b = c') is 'a = b = c' 237 FAIL compileAndSerialize('(a = b) = c') should be (a = b) = c. Threw exception ReferenceError: Invalid left-hand side in assignment 238 PASS compileAndSerialize('a = (b = c)') is 'a = (b = c)' 239 PASS compileAndSerialize('a = b + c') is 'a = b + c' 240 PASS compileAndSerialize('(a = b) + c') is '(a = b) + c' 241 PASS compileAndSerialize('a = (b + c)') is 'a = (b + c)' 242 PASS compileAndSerialize('a + b = c') threw exception ReferenceError: Invalid left-hand side in assignment. 243 FAIL compileAndSerialize('(a + b) = c') should be (a + b) = c. Threw exception ReferenceError: Invalid left-hand side in assignment 244 PASS compileAndSerialize('a + (b = c)') is 'a + (b = c)' 245 PASS compileAndSerialize('a *= b *= c') is 'a *= b *= c' 246 FAIL compileAndSerialize('(a *= b) *= c') should be (a *= b) *= c. Threw exception ReferenceError: Invalid left-hand side in assignment 247 PASS compileAndSerialize('a *= (b *= c)') is 'a *= (b *= c)' 248 PASS compileAndSerialize('a = b *= c') is 'a = b *= c' 249 FAIL compileAndSerialize('(a = b) *= c') should be (a = b) *= c. Threw exception ReferenceError: Invalid left-hand side in assignment 250 PASS compileAndSerialize('a = (b *= c)') is 'a = (b *= c)' 251 PASS compileAndSerialize('a *= b + c') is 'a *= b + c' 252 PASS compileAndSerialize('(a *= b) + c') is '(a *= b) + c' 253 PASS compileAndSerialize('a *= (b + c)') is 'a *= (b + c)' 254 PASS compileAndSerialize('a + b *= c') threw exception ReferenceError: Invalid left-hand side in assignment. 255 FAIL compileAndSerialize('(a + b) *= c') should be (a + b) *= c. Threw exception ReferenceError: Invalid left-hand side in assignment 256 PASS compileAndSerialize('a + (b *= c)') is 'a + (b *= c)' 257 PASS compileAndSerialize('a /= b /= c') is 'a /= b /= c' 258 FAIL compileAndSerialize('(a /= b) /= c') should be (a /= b) /= c. Threw exception ReferenceError: Invalid left-hand side in assignment 259 PASS compileAndSerialize('a /= (b /= c)') is 'a /= (b /= c)' 260 PASS compileAndSerialize('a = b /= c') is 'a = b /= c' 261 FAIL compileAndSerialize('(a = b) /= c') should be (a = b) /= c. Threw exception ReferenceError: Invalid left-hand side in assignment 262 PASS compileAndSerialize('a = (b /= c)') is 'a = (b /= c)' 263 PASS compileAndSerialize('a /= b + c') is 'a /= b + c' 264 PASS compileAndSerialize('(a /= b) + c') is '(a /= b) + c' 265 PASS compileAndSerialize('a /= (b + c)') is 'a /= (b + c)' 266 PASS compileAndSerialize('a + b /= c') threw exception ReferenceError: Invalid left-hand side in assignment. 267 FAIL compileAndSerialize('(a + b) /= c') should be (a + b) /= c. Threw exception ReferenceError: Invalid left-hand side in assignment 268 PASS compileAndSerialize('a + (b /= c)') is 'a + (b /= c)' 269 PASS compileAndSerialize('a %= b %= c') is 'a %= b %= c' 270 FAIL compileAndSerialize('(a %= b) %= c') should be (a %= b) %= c. Threw exception ReferenceError: Invalid left-hand side in assignment 271 PASS compileAndSerialize('a %= (b %= c)') is 'a %= (b %= c)' 272 PASS compileAndSerialize('a = b %= c') is 'a = b %= c' 273 FAIL compileAndSerialize('(a = b) %= c') should be (a = b) %= c. Threw exception ReferenceError: Invalid left-hand side in assignment 274 PASS compileAndSerialize('a = (b %= c)') is 'a = (b %= c)' 275 PASS compileAndSerialize('a %= b + c') is 'a %= b + c' 276 PASS compileAndSerialize('(a %= b) + c') is '(a %= b) + c' 277 PASS compileAndSerialize('a %= (b + c)') is 'a %= (b + c)' 278 PASS compileAndSerialize('a + b %= c') threw exception ReferenceError: Invalid left-hand side in assignment. 279 FAIL compileAndSerialize('(a + b) %= c') should be (a + b) %= c. Threw exception ReferenceError: Invalid left-hand side in assignment 280 PASS compileAndSerialize('a + (b %= c)') is 'a + (b %= c)' 281 PASS compileAndSerialize('a += b += c') is 'a += b += c' 282 FAIL compileAndSerialize('(a += b) += c') should be (a += b) += c. Threw exception ReferenceError: Invalid left-hand side in assignment 283 PASS compileAndSerialize('a += (b += c)') is 'a += (b += c)' 284 PASS compileAndSerialize('a = b += c') is 'a = b += c' 285 FAIL compileAndSerialize('(a = b) += c') should be (a = b) += c. Threw exception ReferenceError: Invalid left-hand side in assignment 286 PASS compileAndSerialize('a = (b += c)') is 'a = (b += c)' 287 PASS compileAndSerialize('a += b + c') is 'a += b + c' 288 PASS compileAndSerialize('(a += b) + c') is '(a += b) + c' 289 PASS compileAndSerialize('a += (b + c)') is 'a += (b + c)' 290 PASS compileAndSerialize('a + b += c') threw exception ReferenceError: Invalid left-hand side in assignment. 291 FAIL compileAndSerialize('(a + b) += c') should be (a + b) += c. Threw exception ReferenceError: Invalid left-hand side in assignment 292 PASS compileAndSerialize('a + (b += c)') is 'a + (b += c)' 293 PASS compileAndSerialize('a -= b -= c') is 'a -= b -= c' 294 FAIL compileAndSerialize('(a -= b) -= c') should be (a -= b) -= c. Threw exception ReferenceError: Invalid left-hand side in assignment 295 PASS compileAndSerialize('a -= (b -= c)') is 'a -= (b -= c)' 296 PASS compileAndSerialize('a = b -= c') is 'a = b -= c' 297 FAIL compileAndSerialize('(a = b) -= c') should be (a = b) -= c. Threw exception ReferenceError: Invalid left-hand side in assignment 298 PASS compileAndSerialize('a = (b -= c)') is 'a = (b -= c)' 299 PASS compileAndSerialize('a -= b + c') is 'a -= b + c' 300 PASS compileAndSerialize('(a -= b) + c') is '(a -= b) + c' 301 PASS compileAndSerialize('a -= (b + c)') is 'a -= (b + c)' 302 PASS compileAndSerialize('a + b -= c') threw exception ReferenceError: Invalid left-hand side in assignment. 303 FAIL compileAndSerialize('(a + b) -= c') should be (a + b) -= c. Threw exception ReferenceError: Invalid left-hand side in assignment 304 PASS compileAndSerialize('a + (b -= c)') is 'a + (b -= c)' 305 PASS compileAndSerialize('a <<= b <<= c') is 'a <<= b <<= c' 306 FAIL compileAndSerialize('(a <<= b) <<= c') should be (a <<= b) <<= c. Threw exception ReferenceError: Invalid left-hand side in assignment 307 PASS compileAndSerialize('a <<= (b <<= c)') is 'a <<= (b <<= c)' 308 PASS compileAndSerialize('a = b <<= c') is 'a = b <<= c' 309 FAIL compileAndSerialize('(a = b) <<= c') should be (a = b) <<= c. Threw exception ReferenceError: Invalid left-hand side in assignment 310 PASS compileAndSerialize('a = (b <<= c)') is 'a = (b <<= c)' 311 PASS compileAndSerialize('a <<= b + c') is 'a <<= b + c' 312 PASS compileAndSerialize('(a <<= b) + c') is '(a <<= b) + c' 313 PASS compileAndSerialize('a <<= (b + c)') is 'a <<= (b + c)' 314 PASS compileAndSerialize('a + b <<= c') threw exception ReferenceError: Invalid left-hand side in assignment. 315 FAIL compileAndSerialize('(a + b) <<= c') should be (a + b) <<= c. Threw exception ReferenceError: Invalid left-hand side in assignment 316 PASS compileAndSerialize('a + (b <<= c)') is 'a + (b <<= c)' 317 PASS compileAndSerialize('a >>= b >>= c') is 'a >>= b >>= c' 318 FAIL compileAndSerialize('(a >>= b) >>= c') should be (a >>= b) >>= c. Threw exception ReferenceError: Invalid left-hand side in assignment 319 PASS compileAndSerialize('a >>= (b >>= c)') is 'a >>= (b >>= c)' 320 PASS compileAndSerialize('a = b >>= c') is 'a = b >>= c' 321 FAIL compileAndSerialize('(a = b) >>= c') should be (a = b) >>= c. Threw exception ReferenceError: Invalid left-hand side in assignment 322 PASS compileAndSerialize('a = (b >>= c)') is 'a = (b >>= c)' 323 PASS compileAndSerialize('a >>= b + c') is 'a >>= b + c' 324 PASS compileAndSerialize('(a >>= b) + c') is '(a >>= b) + c' 325 PASS compileAndSerialize('a >>= (b + c)') is 'a >>= (b + c)' 326 PASS compileAndSerialize('a + b >>= c') threw exception ReferenceError: Invalid left-hand side in assignment. 327 FAIL compileAndSerialize('(a + b) >>= c') should be (a + b) >>= c. Threw exception ReferenceError: Invalid left-hand side in assignment 328 PASS compileAndSerialize('a + (b >>= c)') is 'a + (b >>= c)' 329 PASS compileAndSerialize('a >>>= b >>>= c') is 'a >>>= b >>>= c' 330 FAIL compileAndSerialize('(a >>>= b) >>>= c') should be (a >>>= b) >>>= c. Threw exception ReferenceError: Invalid left-hand side in assignment 331 PASS compileAndSerialize('a >>>= (b >>>= c)') is 'a >>>= (b >>>= c)' 332 PASS compileAndSerialize('a = b >>>= c') is 'a = b >>>= c' 333 FAIL compileAndSerialize('(a = b) >>>= c') should be (a = b) >>>= c. Threw exception ReferenceError: Invalid left-hand side in assignment 334 PASS compileAndSerialize('a = (b >>>= c)') is 'a = (b >>>= c)' 335 PASS compileAndSerialize('a >>>= b + c') is 'a >>>= b + c' 336 PASS compileAndSerialize('(a >>>= b) + c') is '(a >>>= b) + c' 337 PASS compileAndSerialize('a >>>= (b + c)') is 'a >>>= (b + c)' 338 PASS compileAndSerialize('a + b >>>= c') threw exception ReferenceError: Invalid left-hand side in assignment. 339 FAIL compileAndSerialize('(a + b) >>>= c') should be (a + b) >>>= c. Threw exception ReferenceError: Invalid left-hand side in assignment 340 PASS compileAndSerialize('a + (b >>>= c)') is 'a + (b >>>= c)' 341 PASS compileAndSerialize('a &= b &= c') is 'a &= b &= c' 342 FAIL compileAndSerialize('(a &= b) &= c') should be (a &= b) &= c. Threw exception ReferenceError: Invalid left-hand side in assignment 343 PASS compileAndSerialize('a &= (b &= c)') is 'a &= (b &= c)' 344 PASS compileAndSerialize('a = b &= c') is 'a = b &= c' 345 FAIL compileAndSerialize('(a = b) &= c') should be (a = b) &= c. Threw exception ReferenceError: Invalid left-hand side in assignment 346 PASS compileAndSerialize('a = (b &= c)') is 'a = (b &= c)' 347 PASS compileAndSerialize('a &= b + c') is 'a &= b + c' 348 PASS compileAndSerialize('(a &= b) + c') is '(a &= b) + c' 349 PASS compileAndSerialize('a &= (b + c)') is 'a &= (b + c)' 350 PASS compileAndSerialize('a + b &= c') threw exception ReferenceError: Invalid left-hand side in assignment. 351 FAIL compileAndSerialize('(a + b) &= c') should be (a + b) &= c. Threw exception ReferenceError: Invalid left-hand side in assignment 352 PASS compileAndSerialize('a + (b &= c)') is 'a + (b &= c)' 353 PASS compileAndSerialize('a ^= b ^= c') is 'a ^= b ^= c' 354 FAIL compileAndSerialize('(a ^= b) ^= c') should be (a ^= b) ^= c. Threw exception ReferenceError: Invalid left-hand side in assignment 355 PASS compileAndSerialize('a ^= (b ^= c)') is 'a ^= (b ^= c)' 356 PASS compileAndSerialize('a = b ^= c') is 'a = b ^= c' 357 FAIL compileAndSerialize('(a = b) ^= c') should be (a = b) ^= c. Threw exception ReferenceError: Invalid left-hand side in assignment 358 PASS compileAndSerialize('a = (b ^= c)') is 'a = (b ^= c)' 359 PASS compileAndSerialize('a ^= b + c') is 'a ^= b + c' 360 PASS compileAndSerialize('(a ^= b) + c') is '(a ^= b) + c' 361 PASS compileAndSerialize('a ^= (b + c)') is 'a ^= (b + c)' 362 PASS compileAndSerialize('a + b ^= c') threw exception ReferenceError: Invalid left-hand side in assignment. 363 FAIL compileAndSerialize('(a + b) ^= c') should be (a + b) ^= c. Threw exception ReferenceError: Invalid left-hand side in assignment 364 PASS compileAndSerialize('a + (b ^= c)') is 'a + (b ^= c)' 365 PASS compileAndSerialize('a |= b |= c') is 'a |= b |= c' 366 FAIL compileAndSerialize('(a |= b) |= c') should be (a |= b) |= c. Threw exception ReferenceError: Invalid left-hand side in assignment 367 PASS compileAndSerialize('a |= (b |= c)') is 'a |= (b |= c)' 368 PASS compileAndSerialize('a = b |= c') is 'a = b |= c' 369 FAIL compileAndSerialize('(a = b) |= c') should be (a = b) |= c. Threw exception ReferenceError: Invalid left-hand side in assignment 370 PASS compileAndSerialize('a = (b |= c)') is 'a = (b |= c)' 371 PASS compileAndSerialize('a |= b + c') is 'a |= b + c' 372 PASS compileAndSerialize('(a |= b) + c') is '(a |= b) + c' 373 PASS compileAndSerialize('a |= (b + c)') is 'a |= (b + c)' 374 PASS compileAndSerialize('a + b |= c') threw exception ReferenceError: Invalid left-hand side in assignment. 375 FAIL compileAndSerialize('(a + b) |= c') should be (a + b) |= c. Threw exception ReferenceError: Invalid left-hand side in assignment 376 PASS compileAndSerialize('a + (b |= c)') is 'a + (b |= c)' 377 PASS compileAndSerialize('delete a + b') is 'delete a + b' 378 PASS compileAndSerialize('(delete a) + b') is '(delete a) + b' 379 PASS compileAndSerialize('delete (a + b)') is 'delete (a + b)' 380 PASS compileAndSerialize('!delete a') is '!delete a' 381 PASS compileAndSerialize('!(delete a)') is '!(delete a)' 382 PASS compileAndSerialize('void a + b') is 'void a + b' 383 PASS compileAndSerialize('(void a) + b') is '(void a) + b' 384 PASS compileAndSerialize('void (a + b)') is 'void (a + b)' 385 PASS compileAndSerialize('!void a') is '!void a' 386 PASS compileAndSerialize('!(void a)') is '!(void a)' 387 PASS compileAndSerialize('typeof a + b') is 'typeof a + b' 388 PASS compileAndSerialize('(typeof a) + b') is '(typeof a) + b' 389 PASS compileAndSerialize('typeof (a + b)') is 'typeof (a + b)' 390 PASS compileAndSerialize('!typeof a') is '!typeof a' 391 PASS compileAndSerialize('!(typeof a)') is '!(typeof a)' 392 PASS compileAndSerialize('++a + b') is '++a + b' 393 PASS compileAndSerialize('(++a) + b') is '(++a) + b' 394 FAIL compileAndSerialize('++(a + b)') should be ++(a + b). Threw exception ReferenceError: Invalid left-hand side expression in prefix operation 395 PASS compileAndSerialize('!++a') is '!++a' 396 PASS compileAndSerialize('!(++a)') is '!(++a)' 397 PASS compileAndSerialize('--a + b') is '--a + b' 398 PASS compileAndSerialize('(--a) + b') is '(--a) + b' 399 FAIL compileAndSerialize('--(a + b)') should be --(a + b). Threw exception ReferenceError: Invalid left-hand side expression in prefix operation 400 PASS compileAndSerialize('!--a') is '!--a' 401 PASS compileAndSerialize('!(--a)') is '!(--a)' 402 PASS compileAndSerialize('+ a + b') is '+ a + b' 403 PASS compileAndSerialize('(+ a) + b') is '(+ a) + b' 404 PASS compileAndSerialize('+ (a + b)') is '+ (a + b)' 405 PASS compileAndSerialize('!+ a') is '!+ a' 406 PASS compileAndSerialize('!(+ a)') is '!(+ a)' 407 PASS compileAndSerialize('- a + b') is '- a + b' 408 PASS compileAndSerialize('(- a) + b') is '(- a) + b' 409 PASS compileAndSerialize('- (a + b)') is '- (a + b)' 410 PASS compileAndSerialize('!- a') is '!- a' 411 PASS compileAndSerialize('!(- a)') is '!(- a)' 412 PASS compileAndSerialize('~a + b') is '~a + b' 413 PASS compileAndSerialize('(~a) + b') is '(~a) + b' 414 PASS compileAndSerialize('~(a + b)') is '~(a + b)' 415 PASS compileAndSerialize('!~a') is '!~a' 416 PASS compileAndSerialize('!(~a)') is '!(~a)' 417 PASS compileAndSerialize('!a + b') is '!a + b' 418 PASS compileAndSerialize('(!a) + b') is '(!a) + b' 419 PASS compileAndSerialize('!(a + b)') is '!(a + b)' 420 PASS compileAndSerialize('!!a') is '!!a' 421 PASS compileAndSerialize('!(!a)') is '!(!a)' 422 PASS compileAndSerialize('!a++') is '!a++' 423 PASS compileAndSerialize('!(a++)') is '!(a++)' 424 FAIL compileAndSerialize('(!a)++') should be (!a)++. Threw exception ReferenceError: Invalid left-hand side expression in postfix operation 425 PASS compileAndSerialize('!a--') is '!a--' 426 PASS compileAndSerialize('!(a--)') is '!(a--)' 427 FAIL compileAndSerialize('(!a)--') should be (!a)--. Threw exception ReferenceError: Invalid left-hand side expression in postfix operation 428 PASS compileAndSerialize('(-1)[a]') is '(-1)[a]' 429 PASS compileAndSerialize('(-1)[a] = b') is '(-1)[a] = b' 430 PASS compileAndSerialize('(-1)[a] += b') is '(-1)[a] += b' 431 PASS compileAndSerialize('(-1)[a]++') is '(-1)[a]++' 432 PASS compileAndSerialize('++(-1)[a]') is '++(-1)[a]' 433 PASS compileAndSerialize('(-1)[a]()') is '(-1)[a]()' 434 PASS compileAndSerialize('new (-1)()') is 'new (-1)()' 435 PASS compileAndSerialize('(-1).a') is '(-1).a' 436 PASS compileAndSerialize('(-1).a = b') is '(-1).a = b' 437 PASS compileAndSerialize('(-1).a += b') is '(-1).a += b' 438 PASS compileAndSerialize('(-1).a++') is '(-1).a++' 439 PASS compileAndSerialize('++(-1).a') is '++(-1).a' 440 PASS compileAndSerialize('(-1).a()') is '(-1).a()' 441 PASS compileAndSerialize('(- 0)[a]') is '(- 0)[a]' 442 PASS compileAndSerialize('(- 0)[a] = b') is '(- 0)[a] = b' 443 PASS compileAndSerialize('(- 0)[a] += b') is '(- 0)[a] += b' 444 PASS compileAndSerialize('(- 0)[a]++') is '(- 0)[a]++' 445 PASS compileAndSerialize('++(- 0)[a]') is '++(- 0)[a]' 446 PASS compileAndSerialize('(- 0)[a]()') is '(- 0)[a]()' 447 PASS compileAndSerialize('new (- 0)()') is 'new (- 0)()' 448 PASS compileAndSerialize('(- 0).a') is '(- 0).a' 449 PASS compileAndSerialize('(- 0).a = b') is '(- 0).a = b' 450 PASS compileAndSerialize('(- 0).a += b') is '(- 0).a += b' 451 PASS compileAndSerialize('(- 0).a++') is '(- 0).a++' 452 PASS compileAndSerialize('++(- 0).a') is '++(- 0).a' 453 PASS compileAndSerialize('(- 0).a()') is '(- 0).a()' 454 PASS compileAndSerialize('(1)[a]') is '(1)[a]' 455 PASS compileAndSerialize('(1)[a] = b') is '(1)[a] = b' 456 PASS compileAndSerialize('(1)[a] += b') is '(1)[a] += b' 457 PASS compileAndSerialize('(1)[a]++') is '(1)[a]++' 458 PASS compileAndSerialize('++(1)[a]') is '++(1)[a]' 459 PASS compileAndSerialize('(1)[a]()') is '(1)[a]()' 460 PASS compileAndSerialize('new (1)()') is 'new (1)()' 461 PASS compileAndSerialize('(1).a') is '(1).a' 462 PASS compileAndSerialize('(1).a = b') is '(1).a = b' 463 PASS compileAndSerialize('(1).a += b') is '(1).a += b' 464 PASS compileAndSerialize('(1).a++') is '(1).a++' 465 PASS compileAndSerialize('++(1).a') is '++(1).a' 466 PASS compileAndSerialize('(1).a()') is '(1).a()' 467 FAIL compileAndSerialize('(-1) = a') should be (-1) = a. Threw exception ReferenceError: Invalid left-hand side in assignment 468 FAIL compileAndSerialize('(- 0) = a') should be (- 0) = a. Threw exception ReferenceError: Invalid left-hand side in assignment 469 FAIL compileAndSerialize('1 = a') should be 1 = a. Threw exception ReferenceError: Invalid left-hand side in assignment 470 FAIL compileAndSerialize('(-1) *= a') should be (-1) *= a. Threw exception ReferenceError: Invalid left-hand side in assignment 471 FAIL compileAndSerialize('(- 0) *= a') should be (- 0) *= a. Threw exception ReferenceError: Invalid left-hand side in assignment 472 FAIL compileAndSerialize('1 *= a') should be 1 *= a. Threw exception ReferenceError: Invalid left-hand side in assignment 473 FAIL compileAndSerialize('(-1) /= a') should be (-1) /= a. Threw exception ReferenceError: Invalid left-hand side in assignment 474 FAIL compileAndSerialize('(- 0) /= a') should be (- 0) /= a. Threw exception ReferenceError: Invalid left-hand side in assignment 475 FAIL compileAndSerialize('1 /= a') should be 1 /= a. Threw exception ReferenceError: Invalid left-hand side in assignment 476 FAIL compileAndSerialize('(-1) %= a') should be (-1) %= a. Threw exception ReferenceError: Invalid left-hand side in assignment 477 FAIL compileAndSerialize('(- 0) %= a') should be (- 0) %= a. Threw exception ReferenceError: Invalid left-hand side in assignment 478 FAIL compileAndSerialize('1 %= a') should be 1 %= a. Threw exception ReferenceError: Invalid left-hand side in assignment 479 FAIL compileAndSerialize('(-1) += a') should be (-1) += a. Threw exception ReferenceError: Invalid left-hand side in assignment 480 FAIL compileAndSerialize('(- 0) += a') should be (- 0) += a. Threw exception ReferenceError: Invalid left-hand side in assignment 481 FAIL compileAndSerialize('1 += a') should be 1 += a. Threw exception ReferenceError: Invalid left-hand side in assignment 482 FAIL compileAndSerialize('(-1) -= a') should be (-1) -= a. Threw exception ReferenceError: Invalid left-hand side in assignment 483 FAIL compileAndSerialize('(- 0) -= a') should be (- 0) -= a. Threw exception ReferenceError: Invalid left-hand side in assignment 484 FAIL compileAndSerialize('1 -= a') should be 1 -= a. Threw exception ReferenceError: Invalid left-hand side in assignment 485 FAIL compileAndSerialize('(-1) <<= a') should be (-1) <<= a. Threw exception ReferenceError: Invalid left-hand side in assignment 486 FAIL compileAndSerialize('(- 0) <<= a') should be (- 0) <<= a. Threw exception ReferenceError: Invalid left-hand side in assignment 487 FAIL compileAndSerialize('1 <<= a') should be 1 <<= a. Threw exception ReferenceError: Invalid left-hand side in assignment 488 FAIL compileAndSerialize('(-1) >>= a') should be (-1) >>= a. Threw exception ReferenceError: Invalid left-hand side in assignment 489 FAIL compileAndSerialize('(- 0) >>= a') should be (- 0) >>= a. Threw exception ReferenceError: Invalid left-hand side in assignment 490 FAIL compileAndSerialize('1 >>= a') should be 1 >>= a. Threw exception ReferenceError: Invalid left-hand side in assignment 491 FAIL compileAndSerialize('(-1) >>>= a') should be (-1) >>>= a. Threw exception ReferenceError: Invalid left-hand side in assignment 492 FAIL compileAndSerialize('(- 0) >>>= a') should be (- 0) >>>= a. Threw exception ReferenceError: Invalid left-hand side in assignment 493 FAIL compileAndSerialize('1 >>>= a') should be 1 >>>= a. Threw exception ReferenceError: Invalid left-hand side in assignment 494 FAIL compileAndSerialize('(-1) &= a') should be (-1) &= a. Threw exception ReferenceError: Invalid left-hand side in assignment 495 FAIL compileAndSerialize('(- 0) &= a') should be (- 0) &= a. Threw exception ReferenceError: Invalid left-hand side in assignment 496 FAIL compileAndSerialize('1 &= a') should be 1 &= a. Threw exception ReferenceError: Invalid left-hand side in assignment 497 FAIL compileAndSerialize('(-1) ^= a') should be (-1) ^= a. Threw exception ReferenceError: Invalid left-hand side in assignment 498 FAIL compileAndSerialize('(- 0) ^= a') should be (- 0) ^= a. Threw exception ReferenceError: Invalid left-hand side in assignment 499 FAIL compileAndSerialize('1 ^= a') should be 1 ^= a. Threw exception ReferenceError: Invalid left-hand side in assignment 500 FAIL compileAndSerialize('(-1) |= a') should be (-1) |= a. Threw exception ReferenceError: Invalid left-hand side in assignment 501 FAIL compileAndSerialize('(- 0) |= a') should be (- 0) |= a. Threw exception ReferenceError: Invalid left-hand side in assignment 502 FAIL compileAndSerialize('1 |= a') should be 1 |= a. Threw exception ReferenceError: Invalid left-hand side in assignment 503 PASS compileAndSerializeLeftmostTest('({ }).x') is '({ }).x' 504 PASS compileAndSerializeLeftmostTest('x = { }') is 'x = { }' 505 PASS compileAndSerializeLeftmostTest('(function () { })()') is '(function () { })()' 506 PASS compileAndSerializeLeftmostTest('x = function () { }') is 'x = function () { }' 507 PASS compileAndSerializeLeftmostTest('var a') is 'var a' 508 PASS compileAndSerializeLeftmostTest('var a = 1') is 'var a = 1' 509 PASS compileAndSerializeLeftmostTest('var a, b') is 'var a, b' 510 PASS compileAndSerializeLeftmostTest('var a = 1, b = 2') is 'var a = 1, b = 2' 511 PASS compileAndSerializeLeftmostTest('var a, b, c') is 'var a, b, c' 512 PASS compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3') is 'var a = 1, b = 2, c = 3' 513 PASS compileAndSerializeLeftmostTest('const a = 1') is 'const a = 1' 514 PASS compileAndSerializeLeftmostTest('const a = (1, 2)') is 'const a = (1, 2)' 515 FAIL compileAndSerializeLeftmostTest('const a, b = 1') should be const a, b = 1. Threw exception SyntaxError: Missing initializer in const declaration 516 FAIL compileAndSerializeLeftmostTest('const a = 1, b') should be const a = 1, b. Threw exception SyntaxError: Missing initializer in const declaration 517 PASS compileAndSerializeLeftmostTest('const a = 1, b = 1') is 'const a = 1, b = 1' 518 PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = 1') is 'const a = (1, 2), b = 1' 519 PASS compileAndSerializeLeftmostTest('const a = 1, b = (1, 2)') is 'const a = 1, b = (1, 2)' 520 PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = (1, 2)') is 'const a = (1, 2), b = (1, 2)' 521 PASS compileAndSerialize('(function () { new (a.b()).c })') is '(function () { new (a.b()).c })' 522 PASS successfullyParsed is true 523 524 TEST COMPLETE 525 526