perf(compiler): minor perf tweaks
This commit is contained in:
parent
4fef8f342a
commit
51d57b4566
@ -552,8 +552,7 @@ function genObjectExpression(node: ObjectExpression, context: CodegenContext) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
multilines && deindent()
|
multilines && deindent()
|
||||||
const lastChar = context.code[context.code.length - 1]
|
push(multilines ? `}` : ` }`)
|
||||||
push(multilines || /[\])}]/.test(lastChar) ? `}` : ` }`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function genArrayExpression(node: ArrayExpression, context: CodegenContext) {
|
function genArrayExpression(node: ArrayExpression, context: CodegenContext) {
|
||||||
|
@ -595,7 +595,7 @@ function parseAttribute(
|
|||||||
let arg: ExpressionNode | undefined
|
let arg: ExpressionNode | undefined
|
||||||
|
|
||||||
if (match[2]) {
|
if (match[2]) {
|
||||||
const startOffset = name.split(match[2], 2)!.shift()!.length
|
const startOffset = name.indexOf(match[2])
|
||||||
const loc = getSelection(
|
const loc = getSelection(
|
||||||
context,
|
context,
|
||||||
getNewPosition(context, start, startOffset),
|
getNewPosition(context, start, startOffset),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user