Skip to content

Commit df48eec

Browse files
committed
fix(compiler-sfc): remove comma of macro definition
closes #7422
1 parent 0fbc19f commit df48eec

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
@@ -1219,12 +1219,12 @@ export function compileScript(
12191219
} else {
12201220
let start = decl.start! + startOffset
12211221
let end = decl.end! + startOffset
1222-
if (i === 0) {
1223-
// first one, locate the start of the next
1224-
end = node.declarations[i + 1].start! + startOffset
1225-
} else {
1226-
// not first one, locate the end of the prev
1222+
if (i === total - 1) {
1223+
// last one, locate the end of the prev
12271224
start = node.declarations[i - 1].end! + startOffset
1225+
} else {
1226+
// not last one, locate the start of the next
1227+
end = node.declarations[i + 1].start! + startOffset
12281228
}
12291229
s.remove(start, end)
12301230
left--

0 commit comments

Comments
 (0)