Skip to content

Commit b9721f8

Browse files
committed
fix(compiler-sfc): remove comma of macro definition
closes #7422
1 parent 3a7572c commit b9721f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/compiler-sfc/src/compileScript.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,12 +1272,12 @@ export function compileScript(
12721272
} else {
12731273
let start = decl.start! + startOffset
12741274
let end = decl.end! + startOffset
1275-
if (i === 0) {
1276-
// first one, locate the start of the next
1277-
end = node.declarations[i + 1].start! + startOffset
1278-
} else {
1279-
// not first one, locate the end of the prev
1275+
if (i === total - 1) {
1276+
// last one, locate the end of the prev
12801277
start = node.declarations[i - 1].end! + startOffset
1278+
} else {
1279+
// not last one, locate the start of the next
1280+
end = node.declarations[i + 1].start! + startOffset
12811281
}
12821282
s.remove(start, end)
12831283
left--

0 commit comments

Comments
 (0)