[fix] handle AssignmentPattern with ObjectPattern in rewrite_identifier

pull/6715/head
shinyaigeek 5 years ago
parent 4f9a260ab1
commit 372987e231

@ -1044,7 +1044,11 @@ export default class Component {
break;
case 'AssignmentPattern':
if (param.left.type === 'Identifier') {
param.left = get_new_name(param.left);
} else {
rename_identifiers(param.left);
}
break;
}
}

@ -0,0 +1,6 @@
export default {
html: `
<div>hello undefined</div>
<div>hello bar2</div>
`
};

@ -0,0 +1,11 @@
<script>
const hoge = {};
const { foo: { bar } = {} } = hoge;
const hoge2 = {};
const { foo2: { bar2 } = { bar2: "bar2" } } = hoge2;
</script>
<div>hello {bar}</div>
<div>hello {bar2}</div>
Loading…
Cancel
Save