Skip to content

Commit dcc6f36

Browse files
fix(compiler): using guard instead of non-nullish assertion (#13982)
1 parent 8fbe48f commit dcc6f36

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/compiler-core/src/transforms/transformVBindShorthand.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ export const transformVBindShorthand: NodeTransform = (node, context) => {
1919
// #13930 :foo in in-DOM templates will be parsed into :foo="" by browser
2020
(__BROWSER__ &&
2121
prop.exp.type === NodeTypes.SIMPLE_EXPRESSION &&
22-
!prop.exp.content.trim()))
22+
!prop.exp.content.trim())) &&
23+
prop.arg
2324
) {
24-
const arg = prop.arg!
25+
const arg = prop.arg
2526
if (arg.type !== NodeTypes.SIMPLE_EXPRESSION || !arg.isStatic) {
2627
// only simple expression is allowed for same-name shorthand
2728
context.onError(

0 commit comments

Comments
 (0)