|
|
@@ -540,6 +540,16 @@ describe('compiler: expression transform', () => {
|
|
|
const { code } = compileWithBindingMetadata(`<div>{{ literal }}</div>`, {
|
|
|
inline: true
|
|
|
})
|
|
|
+ expect(code).toMatch(`toDisplayString(literal)`)
|
|
|
+ // #7973 should skip patch for literal const
|
|
|
+ expect(code).not.toMatch(
|
|
|
+ `${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ test('literal const handling, non-inline mode', () => {
|
|
|
+ const { code } = compileWithBindingMetadata(`<div>{{ literal }}</div>`)
|
|
|
+ expect(code).toMatch(`toDisplayString(literal)`)
|
|
|
// #7973 should skip patch for literal const
|
|
|
expect(code).not.toMatch(
|
|
|
`${PatchFlags.TEXT} /* ${PatchFlagNames[PatchFlags.TEXT]} */`
|