Skip to content

Commit

Permalink
fix(compiler-sfc): destructure StringLiteral key not register bindings (
Browse files Browse the repository at this point in the history
  • Loading branch information
JuniorTour authored Sep 9, 2021
1 parent 781d2d4 commit c1911ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1347,8 +1347,8 @@ function walkObjectPattern(
) {
for (const p of node.properties) {
if (p.type === 'ObjectProperty') {
// key can only be Identifier in ObjectPattern
if (p.key.type === 'Identifier') {
// key can be Identifier in ObjectPattern or StringLiteral
if (p.key.type === 'Identifier' || p.key.type === 'StringLiteral') {
if (p.key === p.value) {
// const { x } = ...
const type = isDefineCall
Expand Down

0 comments on commit c1911ae

Please sign in to comment.