fix LHS cases for NaN & friends (#1804)

`Infinity = beyond` should not become `1/0 = beyond`
This commit is contained in:
Alex Lam S.L
2017-04-09 03:18:14 +08:00
committed by GitHub
parent 9a978843f5
commit d6fbc365e2
2 changed files with 47 additions and 20 deletions

View File

@@ -957,3 +957,35 @@ delete_binary_2: {
}
expect_stdout: true
}
Infinity_NaN_undefined_LHS: {
beautify = {
beautify: true,
}
input: {
function f() {
Infinity = Infinity;
++Infinity;
Infinity--;
NaN *= NaN;
++NaN;
NaN--;
undefined |= undefined;
++undefined;
undefined--;
}
}
expect_exact: [
"function f() {",
" Infinity = 1 / 0;",
" ++Infinity;",
" Infinity--;",
" NaN *= NaN;",
" ++NaN;",
" NaN--;",
" undefined |= void 0;",
" ++undefined;",
" undefined--;",
"}",
]
}