@@ -13,6 +13,7 @@ import {
13
13
} from '../../src'
14
14
import { transformIf } from '../../src/transforms/vIf'
15
15
import { transformExpression } from '../../src/transforms/transformExpression'
16
+ import { PatchFlagNames , PatchFlags } from '../../../shared/src'
16
17
17
18
function parseWithExpressionTransform (
18
19
template : string ,
@@ -494,7 +495,9 @@ describe('compiler: expression transform', () => {
494
495
setup : BindingTypes . SETUP_MAYBE_REF ,
495
496
setupConst : BindingTypes . SETUP_CONST ,
496
497
data : BindingTypes . DATA ,
497
- options : BindingTypes . OPTIONS
498
+ options : BindingTypes . OPTIONS ,
499
+ reactive : BindingTypes . SETUP_REACTIVE_CONST ,
500
+ literal : BindingTypes . LITERAL_CONST
498
501
}
499
502
500
503
function compileWithBindingMetadata (
@@ -532,5 +535,25 @@ describe('compiler: expression transform', () => {
532
535
expect ( code ) . toMatch ( `_ctx.options` )
533
536
expect ( code ) . toMatchSnapshot ( )
534
537
} )
538
+
539
+ test ( 'literal const handling' , ( ) => {
540
+ const { code } = compileWithBindingMetadata ( `<div>{{ literal }}</div>` , {
541
+ inline : true
542
+ } )
543
+ // #7973 should skip patch for literal const
544
+ expect ( code ) . not . toMatch (
545
+ `${ PatchFlags . TEXT } /* ${ PatchFlagNames [ PatchFlags . TEXT ] } */`
546
+ )
547
+ } )
548
+
549
+ test ( 'reactive const handling' , ( ) => {
550
+ const { code } = compileWithBindingMetadata ( `<div>{{ reactive }}</div>` , {
551
+ inline : true
552
+ } )
553
+ // #7973 should not skip patch for reactive const
554
+ expect ( code ) . toMatch (
555
+ `${ PatchFlags . TEXT } /* ${ PatchFlagNames [ PatchFlags . TEXT ] } */`
556
+ )
557
+ } )
535
558
} )
536
559
} )
0 commit comments