diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index e17fcdb1ccc..cdf3dc187f3 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1208,7 +1208,9 @@ export function compileScript( const removed = new Set() function getLastIndex(i: number) { + console.log(i) while (removed.has(--i)) {} + console.log(i) return i } @@ -1230,7 +1232,7 @@ export function compileScript( // last one, locate the end of the prev start = node.declarations[getLastIndex(i)].end! + startOffset } else { - // not last one, locate the start of the next + // not the last one, locate the start of the next end = node.declarations[i + 1].start! + startOffset } s.remove(start, end)