<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
<html> | |
<head> | |
<link rel="stylesheet" href="resources/js-test-style.css"> | |
<script src="resources/js-test-pre.js"></script> | |
</head> | |
<body> | |
<p id="description"></p> | |
<div id="console"></div> | |
<script> | |
description("This test checks toString() round-trip decompilation for binary and unary operators."); | |
var tests = [ | |
"x + + y", | |
"x + - y", | |
"x - + y", | |
"x - - y", | |
"x * + y", | |
"x * - y", | |
"x / + y", | |
"x / - y", | |
"x % + y", | |
"x % - y", | |
"x++ + y", | |
"x++ - y", | |
"x++ * y", | |
"x++ / y", | |
"x-- + y", | |
"x-- - y", | |
"x-- * y", | |
"x-- / y", | |
"x + ++y", | |
"x - ++y", | |
"x * ++y", | |
"x / ++y", | |
"x + --y", | |
"x - --y", | |
"x * --y", | |
"x / --y", | |
"x++ + ++y", | |
"x++ - ++y", | |
"x++ * ++y", | |
"x++ / ++y", | |
"x-- + ++y", | |
"x-- - ++y", | |
"x-- * ++y", | |
"x-- / ++y", | |
"x++ + --y", | |
"x++ - --y", | |
"x++ * --y", | |
"x++ / --y", | |
"x-- + --y", | |
"x-- - --y", | |
"x-- * --y", | |
"x-- / --y", | |
"+ + x", | |
"+ - x", | |
"- + x", | |
"- - x", | |
"1", | |
"-1", | |
"- -1", | |
"- - 0", | |
"- - NaN" | |
]; | |
for (test in tests) { | |
var decompiledFunction = eval("(function () { " + tests[test] + ";})").toString().replace(/\n/g, ""); | |
shouldBe("decompiledFunction", "'function () { " + tests[test] + ";}'"); | |
} | |
var successfullyParsed = true; | |
</script> | |
<script src="resources/js-test-post.js"></script> | |
</body> | |
</html> |