Allow empty destructuring (#1773)

This commit is contained in:
Anthony Van de Gejuchte 2017-04-03 11:21:27 +02:00 committed by Alex Lam S.L
parent 35bae3fcd0
commit 17f0cc359f
2 changed files with 2 additions and 2 deletions

View File

@ -448,8 +448,6 @@ var AST_ArrowParametersOrSeq = DEFNODE("ArrowParametersOrSeq", "expressions", {
} else if (ex instanceof AST_Hole) {
return ex;
} else if (ex instanceof AST_Destructuring) {
if (ex.names.length == 0)
croak("Invalid destructuring function parameter", ex.start.line, ex.start.col);
ex.names = ex.names.map(to_fun_args);
return insert_default(ex, default_seen_above);
} else if (ex instanceof AST_SymbolRef) {

View File

@ -314,11 +314,13 @@ default_assign: {
function f(a, b = 3) {
console.log(a);
}
g = ([[] = 123]) => {};
}
expect: {
function f(a) {
console.log(a);
}
g = ([[] = 123]) => {};
}
}