From: Evan You Date: Wed, 23 Oct 2019 14:49:16 +0000 (-0400) Subject: fix(compiler-dom): style transform of static styles should not add STYLE patchFlag X-Git-Tag: v3.0.0-alpha.0~333 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=113339c7b600a62cfcc703c6b1f6af646653b05b;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-dom): style transform of static styles should not add STYLE patchFlag --- diff --git a/packages/compiler-core/src/transform.ts b/packages/compiler-core/src/transform.ts index dd979d2358..fe717905ce 100644 --- a/packages/compiler-core/src/transform.ts +++ b/packages/compiler-core/src/transform.ts @@ -215,7 +215,8 @@ function createTransformContext( return createSimpleExpression( `_hoisted_${context.hoists.length}`, false, - exp.loc + exp.loc, + true ) }, cache(exp) { diff --git a/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts b/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts index 87aa7f958f..5c568c2719 100644 --- a/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts +++ b/packages/compiler-dom/__tests__/transforms/transformStyle.spec.ts @@ -77,5 +77,7 @@ describe('compiler: style transform', () => { } ] }) + // should not cause the STYLE patchFlag to be attached + expect((node.codegenNode as CallExpression).arguments.length).toBe(2) }) })