@@ -10,14 +10,15 @@ import {
1010 baseParse as parse ,
1111 transform ,
1212} from '../../src'
13+ import { transformFor } from '../../src/transforms/vFor'
1314import { transformOn } from '../../src/transforms/vOn'
1415import { transformElement } from '../../src/transforms/transformElement'
1516import { transformExpression } from '../../src/transforms/transformExpression'
1617
1718function parseWithVOn ( template : string , options : CompilerOptions = { } ) {
1819 const ast = parse ( template , options )
1920 transform ( ast , {
20- nodeTransforms : [ transformExpression , transformElement ] ,
21+ nodeTransforms : [ transformExpression , transformElement , transformFor ] ,
2122 directiveTransforms : {
2223 on : transformOn ,
2324 } ,
@@ -602,6 +603,17 @@ describe('compiler: transform v-on', () => {
602603 expect ( root . cached ) . toBe ( 1 )
603604 } )
604605
606+ test ( 'unicode identifier should not be cached (v-for)' , ( ) => {
607+ const { root } = parseWithVOn (
608+ `<div v-for="项 in items" :key="value"><div v-on:click="foo(项)"/></div>` ,
609+ {
610+ prefixIdentifiers : true ,
611+ cacheHandlers : true ,
612+ } ,
613+ )
614+ expect ( root . cached ) . toBe ( 0 )
615+ } )
616+
605617 test ( 'inline function expression handler' , ( ) => {
606618 const { root, node } = parseWithVOn ( `<div v-on:click="() => foo()" />` , {
607619 prefixIdentifiers : true ,
0 commit comments