diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index 5c83d1f346ad..202e14fd9813 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -1044,7 +1044,11 @@ export default class Component { break; case 'AssignmentPattern': - param.left = get_new_name(param.left); + if (param.left.type === 'Identifier') { + param.left = get_new_name(param.left); + } else { + rename_identifiers(param.left); + } break; } } diff --git a/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js new file mode 100644 index 000000000000..75025e461407 --- /dev/null +++ b/test/runtime/samples/destructured-assignment-pattern-with-object-pattern/_config.js @@ -0,0 +1,6 @@ +export default { + html: ` +