blob: 9d666401aaa66d1a093af97d7e18b61c8e7d4925 [file] [log] [blame]
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.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS compileAndSerialize('a * b * c') is 'a * b * c'
PASS compileAndSerialize('(a * b) * c') is '(a * b) * c'
PASS compileAndSerialize('a * (b * c)') is 'a * (b * c)'
PASS compileAndSerialize('a * b + c') is 'a * b + c'
PASS compileAndSerialize('(a * b) + c') is '(a * b) + c'
PASS compileAndSerialize('a * (b + c)') is 'a * (b + c)'
PASS compileAndSerialize('a * b - c') is 'a * b - c'
PASS compileAndSerialize('(a * b) - c') is '(a * b) - c'
PASS compileAndSerialize('a * (b - c)') is 'a * (b - c)'
PASS compileAndSerialize('a / b / c') is 'a / b / c'
PASS compileAndSerialize('(a / b) / c') is '(a / b) / c'
PASS compileAndSerialize('a / (b / c)') is 'a / (b / c)'
PASS compileAndSerialize('a * b / c') is 'a * b / c'
PASS compileAndSerialize('(a * b) / c') is '(a * b) / c'
PASS compileAndSerialize('a * (b / c)') is 'a * (b / c)'
PASS compileAndSerialize('a / b + c') is 'a / b + c'
PASS compileAndSerialize('(a / b) + c') is '(a / b) + c'
PASS compileAndSerialize('a / (b + c)') is 'a / (b + c)'
PASS compileAndSerialize('a % b % c') is 'a % b % c'
PASS compileAndSerialize('(a % b) % c') is '(a % b) % c'
PASS compileAndSerialize('a % (b % c)') is 'a % (b % c)'
PASS compileAndSerialize('a * b % c') is 'a * b % c'
PASS compileAndSerialize('(a * b) % c') is '(a * b) % c'
PASS compileAndSerialize('a * (b % c)') is 'a * (b % c)'
PASS compileAndSerialize('a % b + c') is 'a % b + c'
PASS compileAndSerialize('(a % b) + c') is '(a % b) + c'
PASS compileAndSerialize('a % (b + c)') is 'a % (b + c)'
PASS compileAndSerialize('a + b + c') is 'a + b + c'
PASS compileAndSerialize('(a + b) + c') is '(a + b) + c'
PASS compileAndSerialize('a + (b + c)') is 'a + (b + c)'
PASS compileAndSerialize('a + b << c') is 'a + b << c'
PASS compileAndSerialize('(a + b) << c') is '(a + b) << c'
PASS compileAndSerialize('a + (b << c)') is 'a + (b << c)'
PASS compileAndSerialize('a + b >> c') is 'a + b >> c'
PASS compileAndSerialize('(a + b) >> c') is '(a + b) >> c'
PASS compileAndSerialize('a + (b >> c)') is 'a + (b >> c)'
PASS compileAndSerialize('a + b >>> c') is 'a + b >>> c'
PASS compileAndSerialize('(a + b) >>> c') is '(a + b) >>> c'
PASS compileAndSerialize('a + (b >>> c)') is 'a + (b >>> c)'
PASS compileAndSerialize('a - b - c') is 'a - b - c'
PASS compileAndSerialize('(a - b) - c') is '(a - b) - c'
PASS compileAndSerialize('a - (b - c)') is 'a - (b - c)'
PASS compileAndSerialize('a + b - c') is 'a + b - c'
PASS compileAndSerialize('(a + b) - c') is '(a + b) - c'
PASS compileAndSerialize('a + (b - c)') is 'a + (b - c)'
PASS compileAndSerialize('a - b << c') is 'a - b << c'
PASS compileAndSerialize('(a - b) << c') is '(a - b) << c'
PASS compileAndSerialize('a - (b << c)') is 'a - (b << c)'
PASS compileAndSerialize('a << b << c') is 'a << b << c'
PASS compileAndSerialize('(a << b) << c') is '(a << b) << c'
PASS compileAndSerialize('a << (b << c)') is 'a << (b << c)'
PASS compileAndSerialize('a << b < c') is 'a << b < c'
PASS compileAndSerialize('(a << b) < c') is '(a << b) < c'
PASS compileAndSerialize('a << (b < c)') is 'a << (b < c)'
PASS compileAndSerialize('a << b > c') is 'a << b > c'
PASS compileAndSerialize('(a << b) > c') is '(a << b) > c'
PASS compileAndSerialize('a << (b > c)') is 'a << (b > c)'
PASS compileAndSerialize('a << b <= c') is 'a << b <= c'
PASS compileAndSerialize('(a << b) <= c') is '(a << b) <= c'
PASS compileAndSerialize('a << (b <= c)') is 'a << (b <= c)'
PASS compileAndSerialize('a << b >= c') is 'a << b >= c'
PASS compileAndSerialize('(a << b) >= c') is '(a << b) >= c'
PASS compileAndSerialize('a << (b >= c)') is 'a << (b >= c)'
PASS compileAndSerialize('a << b instanceof c') is 'a << b instanceof c'
PASS compileAndSerialize('(a << b) instanceof c') is '(a << b) instanceof c'
PASS compileAndSerialize('a << (b instanceof c)') is 'a << (b instanceof c)'
PASS compileAndSerialize('a << b in c') is 'a << b in c'
PASS compileAndSerialize('(a << b) in c') is '(a << b) in c'
PASS compileAndSerialize('a << (b in c)') is 'a << (b in c)'
PASS compileAndSerialize('a >> b >> c') is 'a >> b >> c'
PASS compileAndSerialize('(a >> b) >> c') is '(a >> b) >> c'
PASS compileAndSerialize('a >> (b >> c)') is 'a >> (b >> c)'
PASS compileAndSerialize('a << b >> c') is 'a << b >> c'
PASS compileAndSerialize('(a << b) >> c') is '(a << b) >> c'
PASS compileAndSerialize('a << (b >> c)') is 'a << (b >> c)'
PASS compileAndSerialize('a >> b < c') is 'a >> b < c'
PASS compileAndSerialize('(a >> b) < c') is '(a >> b) < c'
PASS compileAndSerialize('a >> (b < c)') is 'a >> (b < c)'
PASS compileAndSerialize('a >>> b >>> c') is 'a >>> b >>> c'
PASS compileAndSerialize('(a >>> b) >>> c') is '(a >>> b) >>> c'
PASS compileAndSerialize('a >>> (b >>> c)') is 'a >>> (b >>> c)'
PASS compileAndSerialize('a << b >>> c') is 'a << b >>> c'
PASS compileAndSerialize('(a << b) >>> c') is '(a << b) >>> c'
PASS compileAndSerialize('a << (b >>> c)') is 'a << (b >>> c)'
PASS compileAndSerialize('a >>> b < c') is 'a >>> b < c'
PASS compileAndSerialize('(a >>> b) < c') is '(a >>> b) < c'
PASS compileAndSerialize('a >>> (b < c)') is 'a >>> (b < c)'
PASS compileAndSerialize('a < b < c') is 'a < b < c'
PASS compileAndSerialize('(a < b) < c') is '(a < b) < c'
PASS compileAndSerialize('a < (b < c)') is 'a < (b < c)'
PASS compileAndSerialize('a < b == c') is 'a < b == c'
PASS compileAndSerialize('(a < b) == c') is '(a < b) == c'
PASS compileAndSerialize('a < (b == c)') is 'a < (b == c)'
PASS compileAndSerialize('a < b != c') is 'a < b != c'
PASS compileAndSerialize('(a < b) != c') is '(a < b) != c'
PASS compileAndSerialize('a < (b != c)') is 'a < (b != c)'
PASS compileAndSerialize('a < b === c') is 'a < b === c'
PASS compileAndSerialize('(a < b) === c') is '(a < b) === c'
PASS compileAndSerialize('a < (b === c)') is 'a < (b === c)'
PASS compileAndSerialize('a < b !== c') is 'a < b !== c'
PASS compileAndSerialize('(a < b) !== c') is '(a < b) !== c'
PASS compileAndSerialize('a < (b !== c)') is 'a < (b !== c)'
PASS compileAndSerialize('a > b > c') is 'a > b > c'
PASS compileAndSerialize('(a > b) > c') is '(a > b) > c'
PASS compileAndSerialize('a > (b > c)') is 'a > (b > c)'
PASS compileAndSerialize('a < b > c') is 'a < b > c'
PASS compileAndSerialize('(a < b) > c') is '(a < b) > c'
PASS compileAndSerialize('a < (b > c)') is 'a < (b > c)'
PASS compileAndSerialize('a > b == c') is 'a > b == c'
PASS compileAndSerialize('(a > b) == c') is '(a > b) == c'
PASS compileAndSerialize('a > (b == c)') is 'a > (b == c)'
PASS compileAndSerialize('a <= b <= c') is 'a <= b <= c'
PASS compileAndSerialize('(a <= b) <= c') is '(a <= b) <= c'
PASS compileAndSerialize('a <= (b <= c)') is 'a <= (b <= c)'
PASS compileAndSerialize('a < b <= c') is 'a < b <= c'
PASS compileAndSerialize('(a < b) <= c') is '(a < b) <= c'
PASS compileAndSerialize('a < (b <= c)') is 'a < (b <= c)'
PASS compileAndSerialize('a <= b == c') is 'a <= b == c'
PASS compileAndSerialize('(a <= b) == c') is '(a <= b) == c'
PASS compileAndSerialize('a <= (b == c)') is 'a <= (b == c)'
PASS compileAndSerialize('a >= b >= c') is 'a >= b >= c'
PASS compileAndSerialize('(a >= b) >= c') is '(a >= b) >= c'
PASS compileAndSerialize('a >= (b >= c)') is 'a >= (b >= c)'
PASS compileAndSerialize('a < b >= c') is 'a < b >= c'
PASS compileAndSerialize('(a < b) >= c') is '(a < b) >= c'
PASS compileAndSerialize('a < (b >= c)') is 'a < (b >= c)'
PASS compileAndSerialize('a >= b == c') is 'a >= b == c'
PASS compileAndSerialize('(a >= b) == c') is '(a >= b) == c'
PASS compileAndSerialize('a >= (b == c)') is 'a >= (b == c)'
PASS compileAndSerialize('a instanceof b instanceof c') is 'a instanceof b instanceof c'
PASS compileAndSerialize('(a instanceof b) instanceof c') is '(a instanceof b) instanceof c'
PASS compileAndSerialize('a instanceof (b instanceof c)') is 'a instanceof (b instanceof c)'
PASS compileAndSerialize('a < b instanceof c') is 'a < b instanceof c'
PASS compileAndSerialize('(a < b) instanceof c') is '(a < b) instanceof c'
PASS compileAndSerialize('a < (b instanceof c)') is 'a < (b instanceof c)'
PASS compileAndSerialize('a instanceof b == c') is 'a instanceof b == c'
PASS compileAndSerialize('(a instanceof b) == c') is '(a instanceof b) == c'
PASS compileAndSerialize('a instanceof (b == c)') is 'a instanceof (b == c)'
PASS compileAndSerialize('a in b in c') is 'a in b in c'
PASS compileAndSerialize('(a in b) in c') is '(a in b) in c'
PASS compileAndSerialize('a in (b in c)') is 'a in (b in c)'
PASS compileAndSerialize('a < b in c') is 'a < b in c'
PASS compileAndSerialize('(a < b) in c') is '(a < b) in c'
PASS compileAndSerialize('a < (b in c)') is 'a < (b in c)'
PASS compileAndSerialize('a in b == c') is 'a in b == c'
PASS compileAndSerialize('(a in b) == c') is '(a in b) == c'
PASS compileAndSerialize('a in (b == c)') is 'a in (b == c)'
PASS compileAndSerialize('a == b == c') is 'a == b == c'
PASS compileAndSerialize('(a == b) == c') is '(a == b) == c'
PASS compileAndSerialize('a == (b == c)') is 'a == (b == c)'
PASS compileAndSerialize('a == b & c') is 'a == b & c'
PASS compileAndSerialize('(a == b) & c') is '(a == b) & c'
PASS compileAndSerialize('a == (b & c)') is 'a == (b & c)'
PASS compileAndSerialize('a != b != c') is 'a != b != c'
PASS compileAndSerialize('(a != b) != c') is '(a != b) != c'
PASS compileAndSerialize('a != (b != c)') is 'a != (b != c)'
PASS compileAndSerialize('a == b != c') is 'a == b != c'
PASS compileAndSerialize('(a == b) != c') is '(a == b) != c'
PASS compileAndSerialize('a == (b != c)') is 'a == (b != c)'
PASS compileAndSerialize('a != b & c') is 'a != b & c'
PASS compileAndSerialize('(a != b) & c') is '(a != b) & c'
PASS compileAndSerialize('a != (b & c)') is 'a != (b & c)'
PASS compileAndSerialize('a === b === c') is 'a === b === c'
PASS compileAndSerialize('(a === b) === c') is '(a === b) === c'
PASS compileAndSerialize('a === (b === c)') is 'a === (b === c)'
PASS compileAndSerialize('a == b === c') is 'a == b === c'
PASS compileAndSerialize('(a == b) === c') is '(a == b) === c'
PASS compileAndSerialize('a == (b === c)') is 'a == (b === c)'
PASS compileAndSerialize('a === b & c') is 'a === b & c'
PASS compileAndSerialize('(a === b) & c') is '(a === b) & c'
PASS compileAndSerialize('a === (b & c)') is 'a === (b & c)'
PASS compileAndSerialize('a !== b !== c') is 'a !== b !== c'
PASS compileAndSerialize('(a !== b) !== c') is '(a !== b) !== c'
PASS compileAndSerialize('a !== (b !== c)') is 'a !== (b !== c)'
PASS compileAndSerialize('a == b !== c') is 'a == b !== c'
PASS compileAndSerialize('(a == b) !== c') is '(a == b) !== c'
PASS compileAndSerialize('a == (b !== c)') is 'a == (b !== c)'
PASS compileAndSerialize('a !== b & c') is 'a !== b & c'
PASS compileAndSerialize('(a !== b) & c') is '(a !== b) & c'
PASS compileAndSerialize('a !== (b & c)') is 'a !== (b & c)'
PASS compileAndSerialize('a & b & c') is 'a & b & c'
PASS compileAndSerialize('(a & b) & c') is '(a & b) & c'
PASS compileAndSerialize('a & (b & c)') is 'a & (b & c)'
PASS compileAndSerialize('a & b ^ c') is 'a & b ^ c'
PASS compileAndSerialize('(a & b) ^ c') is '(a & b) ^ c'
PASS compileAndSerialize('a & (b ^ c)') is 'a & (b ^ c)'
PASS compileAndSerialize('a ^ b ^ c') is 'a ^ b ^ c'
PASS compileAndSerialize('(a ^ b) ^ c') is '(a ^ b) ^ c'
PASS compileAndSerialize('a ^ (b ^ c)') is 'a ^ (b ^ c)'
PASS compileAndSerialize('a ^ b | c') is 'a ^ b | c'
PASS compileAndSerialize('(a ^ b) | c') is '(a ^ b) | c'
PASS compileAndSerialize('a ^ (b | c)') is 'a ^ (b | c)'
PASS compileAndSerialize('a | b | c') is 'a | b | c'
PASS compileAndSerialize('(a | b) | c') is '(a | b) | c'
PASS compileAndSerialize('a | (b | c)') is 'a | (b | c)'
PASS compileAndSerialize('a | b && c') is 'a | b && c'
PASS compileAndSerialize('(a | b) && c') is '(a | b) && c'
PASS compileAndSerialize('a | (b && c)') is 'a | (b && c)'
PASS compileAndSerialize('a && b && c') is 'a && b && c'
PASS compileAndSerialize('(a && b) && c') is '(a && b) && c'
PASS compileAndSerialize('a && (b && c)') is 'a && (b && c)'
PASS compileAndSerialize('a && b || c') is 'a && b || c'
PASS compileAndSerialize('(a && b) || c') is '(a && b) || c'
PASS compileAndSerialize('a && (b || c)') is 'a && (b || c)'
PASS compileAndSerialize('a || b || c') is 'a || b || c'
PASS compileAndSerialize('(a || b) || c') is '(a || b) || c'
PASS compileAndSerialize('a || (b || c)') is 'a || (b || c)'
PASS compileAndSerialize('a = b = c') is 'a = b = c'
PASS compileAndSerialize('(a = b) = c') is '(a = b) = c'
PASS compileAndSerialize('a = (b = c)') is 'a = (b = c)'
PASS compileAndSerialize('a = b + c') is 'a = b + c'
PASS compileAndSerialize('(a = b) + c') is '(a = b) + c'
PASS compileAndSerialize('a = (b + c)') is 'a = (b + c)'
PASS compileAndSerialize('a + b = c') threw exception SyntaxError: Left hand side of operator '=' must be a reference..
PASS compileAndSerialize('(a + b) = c') is '(a + b) = c'
PASS compileAndSerialize('a + (b = c)') is 'a + (b = c)'
PASS compileAndSerialize('a *= b *= c') is 'a *= b *= c'
PASS compileAndSerialize('(a *= b) *= c') is '(a *= b) *= c'
PASS compileAndSerialize('a *= (b *= c)') is 'a *= (b *= c)'
PASS compileAndSerialize('a = b *= c') is 'a = b *= c'
PASS compileAndSerialize('(a = b) *= c') is '(a = b) *= c'
PASS compileAndSerialize('a = (b *= c)') is 'a = (b *= c)'
PASS compileAndSerialize('a *= b + c') is 'a *= b + c'
PASS compileAndSerialize('(a *= b) + c') is '(a *= b) + c'
PASS compileAndSerialize('a *= (b + c)') is 'a *= (b + c)'
PASS compileAndSerialize('a + b *= c') threw exception SyntaxError: Left hand side of operator '*=' must be a reference..
PASS compileAndSerialize('(a + b) *= c') is '(a + b) *= c'
PASS compileAndSerialize('a + (b *= c)') is 'a + (b *= c)'
PASS compileAndSerialize('a /= b /= c') is 'a /= b /= c'
PASS compileAndSerialize('(a /= b) /= c') is '(a /= b) /= c'
PASS compileAndSerialize('a /= (b /= c)') is 'a /= (b /= c)'
PASS compileAndSerialize('a = b /= c') is 'a = b /= c'
PASS compileAndSerialize('(a = b) /= c') is '(a = b) /= c'
PASS compileAndSerialize('a = (b /= c)') is 'a = (b /= c)'
PASS compileAndSerialize('a /= b + c') is 'a /= b + c'
PASS compileAndSerialize('(a /= b) + c') is '(a /= b) + c'
PASS compileAndSerialize('a /= (b + c)') is 'a /= (b + c)'
PASS compileAndSerialize('a + b /= c') threw exception SyntaxError: Left hand side of operator '/=' must be a reference..
PASS compileAndSerialize('(a + b) /= c') is '(a + b) /= c'
PASS compileAndSerialize('a + (b /= c)') is 'a + (b /= c)'
PASS compileAndSerialize('a %= b %= c') is 'a %= b %= c'
PASS compileAndSerialize('(a %= b) %= c') is '(a %= b) %= c'
PASS compileAndSerialize('a %= (b %= c)') is 'a %= (b %= c)'
PASS compileAndSerialize('a = b %= c') is 'a = b %= c'
PASS compileAndSerialize('(a = b) %= c') is '(a = b) %= c'
PASS compileAndSerialize('a = (b %= c)') is 'a = (b %= c)'
PASS compileAndSerialize('a %= b + c') is 'a %= b + c'
PASS compileAndSerialize('(a %= b) + c') is '(a %= b) + c'
PASS compileAndSerialize('a %= (b + c)') is 'a %= (b + c)'
PASS compileAndSerialize('a + b %= c') threw exception SyntaxError: Left hand side of operator '%=' must be a reference..
PASS compileAndSerialize('(a + b) %= c') is '(a + b) %= c'
PASS compileAndSerialize('a + (b %= c)') is 'a + (b %= c)'
PASS compileAndSerialize('a += b += c') is 'a += b += c'
PASS compileAndSerialize('(a += b) += c') is '(a += b) += c'
PASS compileAndSerialize('a += (b += c)') is 'a += (b += c)'
PASS compileAndSerialize('a = b += c') is 'a = b += c'
PASS compileAndSerialize('(a = b) += c') is '(a = b) += c'
PASS compileAndSerialize('a = (b += c)') is 'a = (b += c)'
PASS compileAndSerialize('a += b + c') is 'a += b + c'
PASS compileAndSerialize('(a += b) + c') is '(a += b) + c'
PASS compileAndSerialize('a += (b + c)') is 'a += (b + c)'
PASS compileAndSerialize('a + b += c') threw exception SyntaxError: Left hand side of operator '+=' must be a reference..
PASS compileAndSerialize('(a + b) += c') is '(a + b) += c'
PASS compileAndSerialize('a + (b += c)') is 'a + (b += c)'
PASS compileAndSerialize('a -= b -= c') is 'a -= b -= c'
PASS compileAndSerialize('(a -= b) -= c') is '(a -= b) -= c'
PASS compileAndSerialize('a -= (b -= c)') is 'a -= (b -= c)'
PASS compileAndSerialize('a = b -= c') is 'a = b -= c'
PASS compileAndSerialize('(a = b) -= c') is '(a = b) -= c'
PASS compileAndSerialize('a = (b -= c)') is 'a = (b -= c)'
PASS compileAndSerialize('a -= b + c') is 'a -= b + c'
PASS compileAndSerialize('(a -= b) + c') is '(a -= b) + c'
PASS compileAndSerialize('a -= (b + c)') is 'a -= (b + c)'
PASS compileAndSerialize('a + b -= c') threw exception SyntaxError: Left hand side of operator '-=' must be a reference..
PASS compileAndSerialize('(a + b) -= c') is '(a + b) -= c'
PASS compileAndSerialize('a + (b -= c)') is 'a + (b -= c)'
PASS compileAndSerialize('a <<= b <<= c') is 'a <<= b <<= c'
PASS compileAndSerialize('(a <<= b) <<= c') is '(a <<= b) <<= c'
PASS compileAndSerialize('a <<= (b <<= c)') is 'a <<= (b <<= c)'
PASS compileAndSerialize('a = b <<= c') is 'a = b <<= c'
PASS compileAndSerialize('(a = b) <<= c') is '(a = b) <<= c'
PASS compileAndSerialize('a = (b <<= c)') is 'a = (b <<= c)'
PASS compileAndSerialize('a <<= b + c') is 'a <<= b + c'
PASS compileAndSerialize('(a <<= b) + c') is '(a <<= b) + c'
PASS compileAndSerialize('a <<= (b + c)') is 'a <<= (b + c)'
PASS compileAndSerialize('a + b <<= c') threw exception SyntaxError: Left hand side of operator '<<=' must be a reference..
PASS compileAndSerialize('(a + b) <<= c') is '(a + b) <<= c'
PASS compileAndSerialize('a + (b <<= c)') is 'a + (b <<= c)'
PASS compileAndSerialize('a >>= b >>= c') is 'a >>= b >>= c'
PASS compileAndSerialize('(a >>= b) >>= c') is '(a >>= b) >>= c'
PASS compileAndSerialize('a >>= (b >>= c)') is 'a >>= (b >>= c)'
PASS compileAndSerialize('a = b >>= c') is 'a = b >>= c'
PASS compileAndSerialize('(a = b) >>= c') is '(a = b) >>= c'
PASS compileAndSerialize('a = (b >>= c)') is 'a = (b >>= c)'
PASS compileAndSerialize('a >>= b + c') is 'a >>= b + c'
PASS compileAndSerialize('(a >>= b) + c') is '(a >>= b) + c'
PASS compileAndSerialize('a >>= (b + c)') is 'a >>= (b + c)'
PASS compileAndSerialize('a + b >>= c') threw exception SyntaxError: Left hand side of operator '>>=' must be a reference..
PASS compileAndSerialize('(a + b) >>= c') is '(a + b) >>= c'
PASS compileAndSerialize('a + (b >>= c)') is 'a + (b >>= c)'
PASS compileAndSerialize('a >>>= b >>>= c') is 'a >>>= b >>>= c'
PASS compileAndSerialize('(a >>>= b) >>>= c') is '(a >>>= b) >>>= c'
PASS compileAndSerialize('a >>>= (b >>>= c)') is 'a >>>= (b >>>= c)'
PASS compileAndSerialize('a = b >>>= c') is 'a = b >>>= c'
PASS compileAndSerialize('(a = b) >>>= c') is '(a = b) >>>= c'
PASS compileAndSerialize('a = (b >>>= c)') is 'a = (b >>>= c)'
PASS compileAndSerialize('a >>>= b + c') is 'a >>>= b + c'
PASS compileAndSerialize('(a >>>= b) + c') is '(a >>>= b) + c'
PASS compileAndSerialize('a >>>= (b + c)') is 'a >>>= (b + c)'
PASS compileAndSerialize('a + b >>>= c') threw exception SyntaxError: Left hand side of operator '>>>=' must be a reference..
PASS compileAndSerialize('(a + b) >>>= c') is '(a + b) >>>= c'
PASS compileAndSerialize('a + (b >>>= c)') is 'a + (b >>>= c)'
PASS compileAndSerialize('a &= b &= c') is 'a &= b &= c'
PASS compileAndSerialize('(a &= b) &= c') is '(a &= b) &= c'
PASS compileAndSerialize('a &= (b &= c)') is 'a &= (b &= c)'
PASS compileAndSerialize('a = b &= c') is 'a = b &= c'
PASS compileAndSerialize('(a = b) &= c') is '(a = b) &= c'
PASS compileAndSerialize('a = (b &= c)') is 'a = (b &= c)'
PASS compileAndSerialize('a &= b + c') is 'a &= b + c'
PASS compileAndSerialize('(a &= b) + c') is '(a &= b) + c'
PASS compileAndSerialize('a &= (b + c)') is 'a &= (b + c)'
PASS compileAndSerialize('a + b &= c') threw exception SyntaxError: Left hand side of operator '&=' must be a reference..
PASS compileAndSerialize('(a + b) &= c') is '(a + b) &= c'
PASS compileAndSerialize('a + (b &= c)') is 'a + (b &= c)'
PASS compileAndSerialize('a ^= b ^= c') is 'a ^= b ^= c'
PASS compileAndSerialize('(a ^= b) ^= c') is '(a ^= b) ^= c'
PASS compileAndSerialize('a ^= (b ^= c)') is 'a ^= (b ^= c)'
PASS compileAndSerialize('a = b ^= c') is 'a = b ^= c'
PASS compileAndSerialize('(a = b) ^= c') is '(a = b) ^= c'
PASS compileAndSerialize('a = (b ^= c)') is 'a = (b ^= c)'
PASS compileAndSerialize('a ^= b + c') is 'a ^= b + c'
PASS compileAndSerialize('(a ^= b) + c') is '(a ^= b) + c'
PASS compileAndSerialize('a ^= (b + c)') is 'a ^= (b + c)'
PASS compileAndSerialize('a + b ^= c') threw exception SyntaxError: Left hand side of operator '^=' must be a reference..
PASS compileAndSerialize('(a + b) ^= c') is '(a + b) ^= c'
PASS compileAndSerialize('a + (b ^= c)') is 'a + (b ^= c)'
PASS compileAndSerialize('a |= b |= c') is 'a |= b |= c'
PASS compileAndSerialize('(a |= b) |= c') is '(a |= b) |= c'
PASS compileAndSerialize('a |= (b |= c)') is 'a |= (b |= c)'
PASS compileAndSerialize('a = b |= c') is 'a = b |= c'
PASS compileAndSerialize('(a = b) |= c') is '(a = b) |= c'
PASS compileAndSerialize('a = (b |= c)') is 'a = (b |= c)'
PASS compileAndSerialize('a |= b + c') is 'a |= b + c'
PASS compileAndSerialize('(a |= b) + c') is '(a |= b) + c'
PASS compileAndSerialize('a |= (b + c)') is 'a |= (b + c)'
PASS compileAndSerialize('a + b |= c') threw exception SyntaxError: Left hand side of operator '|=' must be a reference..
PASS compileAndSerialize('(a + b) |= c') is '(a + b) |= c'
PASS compileAndSerialize('a + (b |= c)') is 'a + (b |= c)'
PASS compileAndSerialize('delete a + b') is 'delete a + b'
PASS compileAndSerialize('(delete a) + b') is '(delete a) + b'
PASS compileAndSerialize('delete (a + b)') is 'delete (a + b)'
PASS compileAndSerialize('!delete a') is '!delete a'
PASS compileAndSerialize('!(delete a)') is '!(delete a)'
PASS compileAndSerialize('void a + b') is 'void a + b'
PASS compileAndSerialize('(void a) + b') is '(void a) + b'
PASS compileAndSerialize('void (a + b)') is 'void (a + b)'
PASS compileAndSerialize('!void a') is '!void a'
PASS compileAndSerialize('!(void a)') is '!(void a)'
PASS compileAndSerialize('typeof a + b') is 'typeof a + b'
PASS compileAndSerialize('(typeof a) + b') is '(typeof a) + b'
PASS compileAndSerialize('typeof (a + b)') is 'typeof (a + b)'
PASS compileAndSerialize('!typeof a') is '!typeof a'
PASS compileAndSerialize('!(typeof a)') is '!(typeof a)'
PASS compileAndSerialize('++a + b') is '++a + b'
PASS compileAndSerialize('(++a) + b') is '(++a) + b'
PASS compileAndSerialize('++(a + b)') is '++(a + b)'
PASS compileAndSerialize('!++a') is '!++a'
PASS compileAndSerialize('!(++a)') is '!(++a)'
PASS compileAndSerialize('--a + b') is '--a + b'
PASS compileAndSerialize('(--a) + b') is '(--a) + b'
PASS compileAndSerialize('--(a + b)') is '--(a + b)'
PASS compileAndSerialize('!--a') is '!--a'
PASS compileAndSerialize('!(--a)') is '!(--a)'
PASS compileAndSerialize('+ a + b') is '+ a + b'
PASS compileAndSerialize('(+ a) + b') is '(+ a) + b'
PASS compileAndSerialize('+ (a + b)') is '+ (a + b)'
PASS compileAndSerialize('!+ a') is '!+ a'
PASS compileAndSerialize('!(+ a)') is '!(+ a)'
PASS compileAndSerialize('- a + b') is '- a + b'
PASS compileAndSerialize('(- a) + b') is '(- a) + b'
PASS compileAndSerialize('- (a + b)') is '- (a + b)'
PASS compileAndSerialize('!- a') is '!- a'
PASS compileAndSerialize('!(- a)') is '!(- a)'
PASS compileAndSerialize('~a + b') is '~a + b'
PASS compileAndSerialize('(~a) + b') is '(~a) + b'
PASS compileAndSerialize('~(a + b)') is '~(a + b)'
PASS compileAndSerialize('!~a') is '!~a'
PASS compileAndSerialize('!(~a)') is '!(~a)'
PASS compileAndSerialize('!a + b') is '!a + b'
PASS compileAndSerialize('(!a) + b') is '(!a) + b'
PASS compileAndSerialize('!(a + b)') is '!(a + b)'
PASS compileAndSerialize('!!a') is '!!a'
PASS compileAndSerialize('!(!a)') is '!(!a)'
PASS compileAndSerialize('!a++') is '!a++'
PASS compileAndSerialize('!(a++)') is '!(a++)'
PASS compileAndSerialize('(!a)++') is '(!a)++'
PASS compileAndSerialize('!a--') is '!a--'
PASS compileAndSerialize('!(a--)') is '!(a--)'
PASS compileAndSerialize('(!a)--') is '(!a)--'
PASS compileAndSerialize('(-1)[a]') is '(-1)[a]'
PASS compileAndSerialize('(-1)[a] = b') is '(-1)[a] = b'
PASS compileAndSerialize('(-1)[a] += b') is '(-1)[a] += b'
PASS compileAndSerialize('(-1)[a]++') is '(-1)[a]++'
PASS compileAndSerialize('++(-1)[a]') is '++(-1)[a]'
PASS compileAndSerialize('(-1)[a]()') is '(-1)[a]()'
PASS compileAndSerialize('new (-1)()') is 'new (-1)()'
PASS compileAndSerialize('(-1).a') is '(-1).a'
PASS compileAndSerialize('(-1).a = b') is '(-1).a = b'
PASS compileAndSerialize('(-1).a += b') is '(-1).a += b'
PASS compileAndSerialize('(-1).a++') is '(-1).a++'
PASS compileAndSerialize('++(-1).a') is '++(-1).a'
PASS compileAndSerialize('(-1).a()') is '(-1).a()'
PASS compileAndSerialize('(- 0)[a]') is '(- 0)[a]'
PASS compileAndSerialize('(- 0)[a] = b') is '(- 0)[a] = b'
PASS compileAndSerialize('(- 0)[a] += b') is '(- 0)[a] += b'
PASS compileAndSerialize('(- 0)[a]++') is '(- 0)[a]++'
PASS compileAndSerialize('++(- 0)[a]') is '++(- 0)[a]'
PASS compileAndSerialize('(- 0)[a]()') is '(- 0)[a]()'
PASS compileAndSerialize('new (- 0)()') is 'new (- 0)()'
PASS compileAndSerialize('(- 0).a') is '(- 0).a'
PASS compileAndSerialize('(- 0).a = b') is '(- 0).a = b'
PASS compileAndSerialize('(- 0).a += b') is '(- 0).a += b'
PASS compileAndSerialize('(- 0).a++') is '(- 0).a++'
PASS compileAndSerialize('++(- 0).a') is '++(- 0).a'
PASS compileAndSerialize('(- 0).a()') is '(- 0).a()'
PASS compileAndSerialize('(1)[a]') is '(1)[a]'
PASS compileAndSerialize('(1)[a] = b') is '(1)[a] = b'
PASS compileAndSerialize('(1)[a] += b') is '(1)[a] += b'
PASS compileAndSerialize('(1)[a]++') is '(1)[a]++'
PASS compileAndSerialize('++(1)[a]') is '++(1)[a]'
PASS compileAndSerialize('(1)[a]()') is '(1)[a]()'
PASS compileAndSerialize('new (1)()') is 'new (1)()'
PASS compileAndSerialize('(1).a') is '(1).a'
PASS compileAndSerialize('(1).a = b') is '(1).a = b'
PASS compileAndSerialize('(1).a += b') is '(1).a += b'
PASS compileAndSerialize('(1).a++') is '(1).a++'
PASS compileAndSerialize('++(1).a') is '++(1).a'
PASS compileAndSerialize('(1).a()') is '(1).a()'
PASS compileAndSerialize('(-1) = a') is '(-1) = a'
PASS compileAndSerialize('(- 0) = a') is '(- 0) = a'
PASS compileAndSerialize('1 = a') is '1 = a'
PASS compileAndSerialize('(-1) *= a') is '(-1) *= a'
PASS compileAndSerialize('(- 0) *= a') is '(- 0) *= a'
PASS compileAndSerialize('1 *= a') is '1 *= a'
PASS compileAndSerialize('(-1) /= a') is '(-1) /= a'
PASS compileAndSerialize('(- 0) /= a') is '(- 0) /= a'
PASS compileAndSerialize('1 /= a') is '1 /= a'
PASS compileAndSerialize('(-1) %= a') is '(-1) %= a'
PASS compileAndSerialize('(- 0) %= a') is '(- 0) %= a'
PASS compileAndSerialize('1 %= a') is '1 %= a'
PASS compileAndSerialize('(-1) += a') is '(-1) += a'
PASS compileAndSerialize('(- 0) += a') is '(- 0) += a'
PASS compileAndSerialize('1 += a') is '1 += a'
PASS compileAndSerialize('(-1) -= a') is '(-1) -= a'
PASS compileAndSerialize('(- 0) -= a') is '(- 0) -= a'
PASS compileAndSerialize('1 -= a') is '1 -= a'
PASS compileAndSerialize('(-1) <<= a') is '(-1) <<= a'
PASS compileAndSerialize('(- 0) <<= a') is '(- 0) <<= a'
PASS compileAndSerialize('1 <<= a') is '1 <<= a'
PASS compileAndSerialize('(-1) >>= a') is '(-1) >>= a'
PASS compileAndSerialize('(- 0) >>= a') is '(- 0) >>= a'
PASS compileAndSerialize('1 >>= a') is '1 >>= a'
PASS compileAndSerialize('(-1) >>>= a') is '(-1) >>>= a'
PASS compileAndSerialize('(- 0) >>>= a') is '(- 0) >>>= a'
PASS compileAndSerialize('1 >>>= a') is '1 >>>= a'
PASS compileAndSerialize('(-1) &= a') is '(-1) &= a'
PASS compileAndSerialize('(- 0) &= a') is '(- 0) &= a'
PASS compileAndSerialize('1 &= a') is '1 &= a'
PASS compileAndSerialize('(-1) ^= a') is '(-1) ^= a'
PASS compileAndSerialize('(- 0) ^= a') is '(- 0) ^= a'
PASS compileAndSerialize('1 ^= a') is '1 ^= a'
PASS compileAndSerialize('(-1) |= a') is '(-1) |= a'
PASS compileAndSerialize('(- 0) |= a') is '(- 0) |= a'
PASS compileAndSerialize('1 |= a') is '1 |= a'
PASS compileAndSerializeLeftmostTest('({ }).x') is '({ }).x'
PASS compileAndSerializeLeftmostTest('x = { }') is 'x = { }'
PASS compileAndSerializeLeftmostTest('(function () { })()') is '(function () { })()'
PASS compileAndSerializeLeftmostTest('x = function () { }') is 'x = function () { }'
PASS compileAndSerializeLeftmostTest('var a') is 'var a'
PASS compileAndSerializeLeftmostTest('var a = 1') is 'var a = 1'
PASS compileAndSerializeLeftmostTest('var a, b') is 'var a, b'
PASS compileAndSerializeLeftmostTest('var a = 1, b = 2') is 'var a = 1, b = 2'
PASS compileAndSerializeLeftmostTest('var a, b, c') is 'var a, b, c'
PASS compileAndSerializeLeftmostTest('var a = 1, b = 2, c = 3') is 'var a = 1, b = 2, c = 3'
PASS compileAndSerializeLeftmostTest('const a = 1') is 'const a = 1'
PASS compileAndSerializeLeftmostTest('const a = (1, 2)') is 'const a = (1, 2)'
PASS compileAndSerializeLeftmostTest('const a = 10, b = 1') is 'const a = 10, b = 1'
PASS compileAndSerializeLeftmostTest('const a = 1, b = 2') is 'const a = 1, b = 2'
PASS compileAndSerializeLeftmostTest('const a = 1, b = 1') is 'const a = 1, b = 1'
PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = 1') is 'const a = (1, 2), b = 1'
PASS compileAndSerializeLeftmostTest('const a = 1, b = (1, 2)') is 'const a = 1, b = (1, 2)'
PASS compileAndSerializeLeftmostTest('const a = (1, 2), b = (1, 2)') is 'const a = (1, 2), b = (1, 2)'
PASS compileAndSerialize('(function () { new (a.b()).c })') is '(function () { new (a.b()).c })'
PASS successfullyParsed is true
TEST COMPLETE