fix tests

This commit is contained in:
alexlamsl
2017-12-10 14:16:54 +08:00
parent 21c986ff5b
commit 7fd4b66eaa
2 changed files with 11 additions and 9 deletions

View File

@@ -36,19 +36,19 @@ avoid_spread_in_ternary: {
function print(...x) {
console.log(...x);
}
var a = [1, 2], b = [3, 4];
var a = [1, 2], b = [3, 4], m = Math;
if (Math)
if (m)
print(a);
else
print(b);
if (Math)
if (m)
print(...a);
else
print(b);
if (Math.no_such_property)
if (m.no_such_property)
print(a);
else
print(...b);
@@ -57,10 +57,10 @@ avoid_spread_in_ternary: {
function print(...x) {
console.log(...x);
}
var a = [ 1, 2 ], b = [ 3, 4 ];
print(Math ? a : b);
Math ? print(...a) : print(b);
Math.no_such_property ? print(a) : print(...b);
var a = [ 1, 2 ], b = [ 3, 4 ], m = Math;
print(m ? a : b);
m ? print(...a) : print(b);
m.no_such_property ? print(a) : print(...b);
}
expect_stdout: [
"[ 1, 2 ]",

View File

@@ -5130,8 +5130,10 @@ issue_2560_6: {
}
expect: {
function baz() {
// TODO: improve to match `master`
function foo() {}
try {
throw function() {};
throw foo;
} catch (bar) {
return bar;
}