Skip to content

Commit 39ea67a

Browse files
committed
chore: rename v-on guard constants
1 parent e98a85f commit 39ea67a

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

packages/compiler-dom/__tests__/transforms/vOn.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Property
1010
} from '@vue/compiler-core'
1111
import { transformOn } from '../../src/transforms/vOn'
12-
import { V_ON_MODIFIERS_GUARD, V_ON_KEYS_GUARD } from '../../src/runtimeHelpers'
12+
import { V_ON_WITH_MODIFIERS, V_ON_WITH_KEYS } from '../../src/runtimeHelpers'
1313
import { transformElement } from '../../../compiler-core/src/transforms/transformElement'
1414
import { transformExpression } from '../../../compiler-core/src/transforms/transformExpression'
1515
import { createObjectMatcher } from '../../../compiler-core/__tests__/testUtils'
@@ -38,7 +38,7 @@ describe('compiler-dom: transform v-on', () => {
3838
expect(prop).toMatchObject({
3939
type: NodeTypes.JS_PROPERTY,
4040
value: {
41-
callee: V_ON_MODIFIERS_GUARD,
41+
callee: V_ON_WITH_MODIFIERS,
4242
arguments: [{ content: '_ctx.test' }, '["stop","prevent"]']
4343
}
4444
})
@@ -53,7 +53,7 @@ describe('compiler-dom: transform v-on', () => {
5353
type: NodeTypes.JS_PROPERTY,
5454
value: createObjectMatcher({
5555
handler: {
56-
callee: V_ON_MODIFIERS_GUARD,
56+
callee: V_ON_WITH_MODIFIERS,
5757
arguments: [{ content: '_ctx.test' }, '["stop"]']
5858
},
5959
options: createObjectMatcher({
@@ -74,10 +74,10 @@ describe('compiler-dom: transform v-on', () => {
7474
type: NodeTypes.JS_PROPERTY,
7575
value: createObjectMatcher({
7676
handler: {
77-
callee: V_ON_KEYS_GUARD,
77+
callee: V_ON_WITH_KEYS,
7878
arguments: [
7979
{
80-
callee: V_ON_MODIFIERS_GUARD,
80+
callee: V_ON_WITH_MODIFIERS,
8181
arguments: [{ content: '_ctx.test' }, '["stop","ctrl"]']
8282
},
8383
'["a"]'
@@ -98,7 +98,7 @@ describe('compiler-dom: transform v-on', () => {
9898
expect(prop).toMatchObject({
9999
type: NodeTypes.JS_PROPERTY,
100100
value: {
101-
callee: V_ON_MODIFIERS_GUARD,
101+
callee: V_ON_WITH_MODIFIERS,
102102
arguments: [{ content: '_ctx.test' }, '["exact"]']
103103
}
104104
})
@@ -111,7 +111,7 @@ describe('compiler-dom: transform v-on', () => {
111111
expect(prop).toMatchObject({
112112
type: NodeTypes.JS_PROPERTY,
113113
value: {
114-
callee: V_ON_KEYS_GUARD,
114+
callee: V_ON_WITH_KEYS,
115115
arguments: [{ content: '_ctx.test' }, '["enter"]']
116116
}
117117
})

packages/compiler-dom/src/runtimeHelpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ export const V_MODEL_TEXT = Symbol(__DEV__ ? `vModelText` : ``)
66
export const V_MODEL_SELECT = Symbol(__DEV__ ? `vModelSelect` : ``)
77
export const V_MODEL_DYNAMIC = Symbol(__DEV__ ? `vModelDynamic` : ``)
88

9-
export const V_ON_MODIFIERS_GUARD = Symbol(__DEV__ ? `vOnModifiersGuard` : ``)
10-
export const V_ON_KEYS_GUARD = Symbol(__DEV__ ? `vOnKeysGuard` : ``)
9+
export const V_ON_WITH_MODIFIERS = Symbol(__DEV__ ? `vOnModifiersGuard` : ``)
10+
export const V_ON_WITH_KEYS = Symbol(__DEV__ ? `vOnKeysGuard` : ``)
1111

1212
registerRuntimeHelpers({
1313
[V_MODEL_RADIO]: `vModelRadio`,
1414
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
1515
[V_MODEL_TEXT]: `vModelText`,
1616
[V_MODEL_SELECT]: `vModelSelect`,
1717
[V_MODEL_DYNAMIC]: `vModelDynamic`,
18-
[V_ON_MODIFIERS_GUARD]: `withModifiers`,
19-
[V_ON_KEYS_GUARD]: `withKeys`
18+
[V_ON_WITH_MODIFIERS]: `withModifiers`,
19+
[V_ON_WITH_KEYS]: `withKeys`
2020
})

packages/compiler-dom/src/transforms/vOn.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
createSimpleExpression,
88
NodeTypes
99
} from '@vue/compiler-core'
10-
import { V_ON_MODIFIERS_GUARD, V_ON_KEYS_GUARD } from '../runtimeHelpers'
10+
import { V_ON_WITH_MODIFIERS, V_ON_WITH_KEYS } from '../runtimeHelpers'
1111
import { makeMap } from '@vue/shared'
1212

1313
const isEventOptionModifier = /*#__PURE__*/ makeMap(`passive,once,capture`)
@@ -39,7 +39,7 @@ export const transformOn: DirectiveTransform = (dir, node, context) => {
3939
// built-in modifiers that are not keys
4040
const nonKeyModifiers = runtimeModifiers.filter(isNonKeyModifier)
4141
if (nonKeyModifiers.length) {
42-
handlerExp = createCallExpression(context.helper(V_ON_MODIFIERS_GUARD), [
42+
handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
4343
handlerExp,
4444
JSON.stringify(nonKeyModifiers)
4545
])
@@ -53,7 +53,7 @@ export const transformOn: DirectiveTransform = (dir, node, context) => {
5353
!key.isStatic ||
5454
isKeyboardEvent(key.content))
5555
) {
56-
handlerExp = createCallExpression(context.helper(V_ON_KEYS_GUARD), [
56+
handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
5757
handlerExp,
5858
JSON.stringify(keyModifiers)
5959
])

0 commit comments

Comments
 (0)