fix(compiler-core): more robust member expression check when running in node
fix #4640
This commit is contained in:
@@ -41,7 +41,10 @@ export const transformModel: DirectiveTransform = (dir, node, context) => {
|
||||
bindingType &&
|
||||
bindingType !== BindingTypes.SETUP_CONST
|
||||
|
||||
if (!expString.trim() || (!isMemberExpression(expString) && !maybeRef)) {
|
||||
if (
|
||||
!expString.trim() ||
|
||||
(!isMemberExpression(expString, context) && !maybeRef)
|
||||
) {
|
||||
context.onError(
|
||||
createCompilerError(ErrorCodes.X_V_MODEL_MALFORMED_EXPRESSION, exp.loc)
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ export const transformOn: DirectiveTransform = (
|
||||
}
|
||||
let shouldCache: boolean = context.cacheHandlers && !exp && !context.inVOnce
|
||||
if (exp) {
|
||||
const isMemberExp = isMemberExpression(exp.content)
|
||||
const isMemberExp = isMemberExpression(exp.content, context)
|
||||
const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content))
|
||||
const hasMultipleStatements = exp.content.includes(`;`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user