mirror of https://github.com/vuejs/core.git
chore: update type assertion
This commit is contained in:
parent
af488c2676
commit
fab59f5c44
|
@ -208,11 +208,11 @@ export function compileScript(
|
||||||
sourceType: 'module'
|
sourceType: 'module'
|
||||||
}).program
|
}).program
|
||||||
const bindings = analyzeScriptBindings(scriptAst.body)
|
const bindings = analyzeScriptBindings(scriptAst.body)
|
||||||
if (enableReactivityTransform && reactivityTransformer?.shouldTransform(content)) {
|
if (enableReactivityTransform && reactivityTransformer!.shouldTransform(content)) {
|
||||||
const s = new MagicString(source)
|
const s = new MagicString(source)
|
||||||
const startOffset = script.loc.start.offset
|
const startOffset = script.loc.start.offset
|
||||||
const endOffset = script.loc.end.offset
|
const endOffset = script.loc.end.offset
|
||||||
const { importedHelpers } = reactivityTransformer.transformAST(scriptAst, s, startOffset)
|
const { importedHelpers } = reactivityTransformer!.transformAST(scriptAst, s, startOffset)
|
||||||
if (importedHelpers.length) {
|
if (importedHelpers.length) {
|
||||||
s.prepend(
|
s.prepend(
|
||||||
`import { ${importedHelpers
|
`import { ${importedHelpers
|
||||||
|
@ -880,8 +880,8 @@ export function compileScript(
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply reactivity transform
|
// apply reactivity transform
|
||||||
if (enableReactivityTransform && reactivityTransformer?.shouldTransform(script.content)) {
|
if (enableReactivityTransform && reactivityTransformer!.shouldTransform(script.content)) {
|
||||||
const { rootRefs, importedHelpers } = reactivityTransformer.transformAST(
|
const { rootRefs, importedHelpers } = reactivityTransformer!.transformAST(
|
||||||
scriptAst,
|
scriptAst,
|
||||||
s,
|
s,
|
||||||
scriptStartOffset!
|
scriptStartOffset!
|
||||||
|
@ -1132,7 +1132,7 @@ export function compileScript(
|
||||||
if (
|
if (
|
||||||
(enableReactivityTransform &&
|
(enableReactivityTransform &&
|
||||||
// normal <script> had ref bindings that maybe used in <script setup>
|
// normal <script> had ref bindings that maybe used in <script setup>
|
||||||
(refBindings || reactivityTransformer?.shouldTransform(scriptSetup.content))) ||
|
(refBindings || reactivityTransformer!.shouldTransform(scriptSetup.content))) ||
|
||||||
propsDestructureDecl
|
propsDestructureDecl
|
||||||
) {
|
) {
|
||||||
const { rootRefs, importedHelpers } = reactivityTransformer!.transformAST(
|
const { rootRefs, importedHelpers } = reactivityTransformer!.transformAST(
|
||||||
|
|
Loading…
Reference in New Issue