Allow AST_DefaultAssign as parameter (#1778)

This may be the case for parsing arrow functions,
as left side expressions are converted to destructuring patterns
before being converted to parameters.
This commit is contained in:
Anthony Van de Gejuchte
2017-04-03 18:46:05 +02:00
committed by Alex Lam S.L
parent 17f0cc359f
commit 603d92effc
2 changed files with 15 additions and 0 deletions

View File

@@ -314,13 +314,25 @@ default_assign: {
function f(a, b = 3) {
console.log(a);
}
g = ([[] = 123]) => {};
h = ([[x, y, z] = [4, 5, 6]] = []) => {};
function i([[x, y, z] = [4, 5, 6]] = []) {
console.log(b);
};
}
expect: {
function f(a) {
console.log(a);
}
g = ([[] = 123]) => {};
h = ([[x, y, z] = [4, 5, 6]] = []) => {};
function i([[x, y, z] = [4, 5, 6]] = []) {
console.log(b);
};
}
}