mirror of https://github.com/vuejs/core.git
fix(compiler-core): fix v-on with modifiers on inline expression of undefined (#9866)
close #9865 improve isMemberExpression check for undefined
This commit is contained in:
parent
24b1c1dd57
commit
bae79ddf85
|
@ -122,6 +122,10 @@ describe('isMemberExpression', () => {
|
|||
expect(fn(`123[a]`)).toBe(true)
|
||||
expect(fn(`foo() as string`)).toBe(false)
|
||||
expect(fn(`a + b as string`)).toBe(false)
|
||||
// #9865
|
||||
expect(fn('""')).toBe(false)
|
||||
expect(fn('undefined')).toBe(false)
|
||||
expect(fn('null')).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ export const isMemberExpressionNode = __BROWSER__
|
|||
return (
|
||||
ret.type === 'MemberExpression' ||
|
||||
ret.type === 'OptionalMemberExpression' ||
|
||||
ret.type === 'Identifier'
|
||||
(ret.type === 'Identifier' && ret.name !== 'undefined')
|
||||
)
|
||||
} catch (e) {
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue