Skip to content

Commit 2e1556a

Browse files
hydratisxzz
authored andcommitted
fix: avoid duplicated equals
1 parent 415f75e commit 2e1556a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

packages/compiler-sfc/src/parse.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,19 +195,14 @@ export function parse(
195195
case 'script':
196196
const scriptBlock = createBlock(node, source, pad) as SFCScriptBlock
197197
const isSetup = !!scriptBlock.attrs.setup
198-
if (isSetup && defaultScriptSetupLang) {
199-
scriptBlock.lang ??= defaultScriptSetupLang
200-
}
201-
202-
if (defaultScriptLang) {
203-
scriptBlock.lang ??= defaultScriptLang
204-
}
205198

206199
if (isSetup && !descriptor.scriptSetup) {
200+
scriptBlock.lang ??= defaultScriptSetupLang ?? defaultScriptLang
207201
descriptor.scriptSetup = scriptBlock
208202
break
209203
}
210204
if (!isSetup && !descriptor.script) {
205+
scriptBlock.lang ??= defaultScriptLang
211206
descriptor.script = scriptBlock
212207
break
213208
}

0 commit comments

Comments
 (0)