Skip to content

Commit

Permalink
perf: optimize position cloning
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 25, 2023
1 parent 79d3cc6 commit 2073236
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/compiler-core/src/utils.ts
Expand Up @@ -36,7 +36,7 @@ import {
GUARD_REACTIVE_PROPS,
WITH_MEMO
} from './runtimeHelpers'
import { isString, isObject, extend, NOOP } from '@vue/shared'
import { isString, isObject, NOOP } from '@vue/shared'
import { PropsExpression } from './transforms/transformElement'
import { parseExpression } from '@babel/parser'
import { Expression } from '@babel/types'
Expand Down Expand Up @@ -181,7 +181,11 @@ export function advancePositionWithClone(
numberOfCharacters: number = source.length
): Position {
return advancePositionWithMutation(
extend({}, pos),
{
offset: pos.offset,
line: pos.line,
column: pos.column
},
source,
numberOfCharacters
)
Expand Down

0 comments on commit 2073236

Please sign in to comment.