refactor(compiler-core): simplify hoistStatic check for nodes without patchFlag

close #1912
This commit is contained in:
Evan You
2020-08-20 11:43:34 -04:00
parent 255a2bd178
commit 91700fbec2
4 changed files with 42 additions and 24 deletions

View File

@@ -19,7 +19,8 @@ import {
BlockCodegenNode,
IfNode,
createVNodeCall,
AttributeNode
AttributeNode,
locStub
} from '../ast'
import { createCompilerError, ErrorCodes } from '../errors'
import { processExpression } from './transformExpression'
@@ -222,7 +223,7 @@ function createChildrenCodegenNode(
const { helper } = context
const keyProperty = createObjectProperty(
`key`,
createSimpleExpression(`${keyIndex}`, false)
createSimpleExpression(`${keyIndex}`, false, locStub, true)
)
const { children } = branch
const firstChild = children[0]