Skip to content

Commit cd1cf47

Browse files
committed
fix: cache key conflict
1 parent a976c24 commit cd1cf47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/compiler-sfc/src/parse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function parse(
107107
sourceRoot +
108108
pad +
109109
compiler.parse +
110-
(defaultScriptLang ? '@' + defaultScriptLang : '')
110+
(defaultScriptLang != null ? '@' + defaultScriptLang : '')
111111
const cache = sourceToSFC.get(sourceKey)
112112
if (cache) {
113113
return cache
@@ -199,12 +199,12 @@ export function parse(
199199
const scriptBlock = createBlock(node, source, pad) as SFCScriptBlock
200200
const isSetup = !!scriptBlock.attrs.setup
201201
if (isSetup && !descriptor.scriptSetup) {
202-
if (!scriptBlock.lang) scriptBlock.lang = defaultScriptLang
202+
if (scriptBlock.lang == null) scriptBlock.lang = defaultScriptLang
203203
descriptor.scriptSetup = scriptBlock
204204
break
205205
}
206206
if (!isSetup && !descriptor.script) {
207-
if (!scriptBlock.lang) scriptBlock.lang = defaultScriptLang
207+
if (scriptBlock.lang == null) scriptBlock.lang = defaultScriptLang
208208
descriptor.script = scriptBlock
209209
break
210210
}

0 commit comments

Comments
 (0)