}
}
+export function cloneLoc(loc: SourceLocation): SourceLocation {
+ return getLoc(loc.start.offset, loc.end.offset)
+}
+
function setLocEnd(loc: SourceLocation, end: number) {
loc.end = tokenizer.getPos(end)
loc.source = getSlice(loc.start.offset, end)
import { ErrorCodes, createCompilerError } from '../errors'
import { processExpression } from './transformExpression'
import { validateBrowserExpression } from '../validateExpression'
+import { cloneLoc } from '../parser'
import { CREATE_COMMENT, FRAGMENT } from '../runtimeHelpers'
import { findDir, findProp, getMemoedVNodeCall, injectProp } from '../utils'
import { PatchFlags } from '@vue/shared'
const branch = createIfBranch(node, dir)
const ifNode: IfNode = {
type: NodeTypes.IF,
- loc: node.loc,
+ loc: cloneLoc(node.loc),
branches: [branch],
}
context.replaceNode(ifNode)