Skip to content

Commit 2073236

Browse files
committedNov 25, 2023
perf: optimize position cloning
1 parent 79d3cc6 commit 2073236

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎packages/compiler-core/src/utils.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
GUARD_REACTIVE_PROPS,
3737
WITH_MEMO
3838
} from './runtimeHelpers'
39-
import { isString, isObject, extend, NOOP } from '@vue/shared'
39+
import { isString, isObject, NOOP } from '@vue/shared'
4040
import { PropsExpression } from './transforms/transformElement'
4141
import { parseExpression } from '@babel/parser'
4242
import { Expression } from '@babel/types'
@@ -181,7 +181,11 @@ export function advancePositionWithClone(
181181
numberOfCharacters: number = source.length
182182
): Position {
183183
return advancePositionWithMutation(
184-
extend({}, pos),
184+
{
185+
offset: pos.offset,
186+
line: pos.line,
187+
column: pos.column
188+
},
185189
source,
186190
numberOfCharacters
187191
)

0 commit comments

Comments
 (0)
Please sign in to comment.