fix: do not use lookbehind regex yet
This commit is contained in:
parent
7c030ee899
commit
2e3a1ff3c3
@ -259,7 +259,7 @@ describe('compiler: transform v-for', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('de-structured value', () => {
|
test('de-structured value', () => {
|
||||||
const source = '<span v-for="( { id, key })in items" />'
|
const source = '<span v-for="( { id, key }) in items" />'
|
||||||
const forNode = parseWithForTransform(source)
|
const forNode = parseWithForTransform(source)
|
||||||
|
|
||||||
const valueIndex = source.indexOf('{ id, key }')
|
const valueIndex = source.indexOf('{ id, key }')
|
||||||
|
@ -13,10 +13,6 @@ import { getInnerRange } from '../utils'
|
|||||||
import { RENDER_LIST } from '../runtimeConstants'
|
import { RENDER_LIST } from '../runtimeConstants'
|
||||||
import { processExpression } from './transformExpression'
|
import { processExpression } from './transformExpression'
|
||||||
|
|
||||||
const forAliasRE = /([\s\S]*?)(?:(?<=\))|\s+)(?:in|of)\s+([\s\S]*)/
|
|
||||||
const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
|
|
||||||
const stripParensRE = /^\(|\)$/g
|
|
||||||
|
|
||||||
export const transformFor = createStructuralDirectiveTransform(
|
export const transformFor = createStructuralDirectiveTransform(
|
||||||
'for',
|
'for',
|
||||||
(node, dir, context) => {
|
(node, dir, context) => {
|
||||||
@ -64,6 +60,10 @@ export const transformFor = createStructuralDirectiveTransform(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/
|
||||||
|
const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
|
||||||
|
const stripParensRE = /^\(|\)$/g
|
||||||
|
|
||||||
interface ForParseResult {
|
interface ForParseResult {
|
||||||
source: ExpressionNode
|
source: ExpressionNode
|
||||||
value: ExpressionNode | undefined
|
value: ExpressionNode | undefined
|
||||||
|
Loading…
Reference in New Issue
Block a user