From: Anthony Fu Date: Fri, 13 May 2022 08:12:32 +0000 (+0800) Subject: chore: update type assertion X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fab59f5c443c223afa67fc75408a09a109282bb9;p=thirdparty%2Fvuejs%2Fcore.git chore: update type assertion --- diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 35b613afbd..62540dfe33 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -208,11 +208,11 @@ export function compileScript( sourceType: 'module' }).program const bindings = analyzeScriptBindings(scriptAst.body) - if (enableReactivityTransform && reactivityTransformer?.shouldTransform(content)) { + if (enableReactivityTransform && reactivityTransformer!.shouldTransform(content)) { const s = new MagicString(source) const startOffset = script.loc.start.offset const endOffset = script.loc.end.offset - const { importedHelpers } = reactivityTransformer.transformAST(scriptAst, s, startOffset) + const { importedHelpers } = reactivityTransformer!.transformAST(scriptAst, s, startOffset) if (importedHelpers.length) { s.prepend( `import { ${importedHelpers @@ -880,8 +880,8 @@ export function compileScript( } // apply reactivity transform - if (enableReactivityTransform && reactivityTransformer?.shouldTransform(script.content)) { - const { rootRefs, importedHelpers } = reactivityTransformer.transformAST( + if (enableReactivityTransform && reactivityTransformer!.shouldTransform(script.content)) { + const { rootRefs, importedHelpers } = reactivityTransformer!.transformAST( scriptAst, s, scriptStartOffset! @@ -1132,7 +1132,7 @@ export function compileScript( if ( (enableReactivityTransform && // normal