Skip to content

Commit 3990807

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

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
@@ -1225,12 +1225,12 @@ export function compileScript(
12251225
} else {
12261226
let start = decl.start! + startOffset
12271227
let end = decl.end! + startOffset
1228-
if (i === 0) {
1229-
// first one, locate the start of the next
1230-
end = node.declarations[i + 1].start! + startOffset
1231-
} else {
1232-
// not first one, locate the end of the prev
1228+
if (i === total - 1) {
1229+
// last one, locate the end of the prev
12331230
start = node.declarations[i - 1].end! + startOffset
1231+
} else {
1232+
// not last one, locate the start of the next
1233+
end = node.declarations[i + 1].start! + startOffset
12341234
}
12351235
s.remove(start, end)
12361236
left--

0 commit comments

Comments
 (0)