refactor: directly use regex
This commit is contained in:
parent
342a9f3a03
commit
8cafad1fd3
@ -1,7 +1,7 @@
|
|||||||
import { autorun, stop } from '@vue/observer'
|
import { autorun, stop } from '@vue/observer'
|
||||||
import { queueJob } from '@vue/scheduler'
|
import { queueJob } from '@vue/scheduler'
|
||||||
import { VNodeFlags, ChildrenFlags } from './flags'
|
import { VNodeFlags, ChildrenFlags } from './flags'
|
||||||
import { EMPTY_OBJ, isReservedProp, lis } from './utils'
|
import { EMPTY_OBJ, reservedPropRE, lis } from './utils'
|
||||||
import {
|
import {
|
||||||
VNode,
|
VNode,
|
||||||
MountedVNode,
|
MountedVNode,
|
||||||
@ -382,7 +382,7 @@ export function createRenderer(options: RendererOptions) {
|
|||||||
nextVNode: VNode,
|
nextVNode: VNode,
|
||||||
isSVG: boolean
|
isSVG: boolean
|
||||||
) {
|
) {
|
||||||
if (isReservedProp(key)) {
|
if (reservedPropRE.test(key)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
platformPatchData(
|
platformPatchData(
|
||||||
|
@ -4,9 +4,7 @@ export const NOOP = () => {}
|
|||||||
|
|
||||||
export const onRE = /^on/
|
export const onRE = /^on/
|
||||||
export const nativeOnRE = /^nativeOn/
|
export const nativeOnRE = /^nativeOn/
|
||||||
|
export const reservedPropRE = /^(?:key|ref|slots)$|^nativeOn/
|
||||||
const reserveRE = /^(?:key|ref|slots)$|^nativeOn/
|
|
||||||
export const isReservedProp = (key: string): boolean => reserveRE.test(key)
|
|
||||||
|
|
||||||
export function normalizeStyle(
|
export function normalizeStyle(
|
||||||
value: any
|
value: any
|
||||||
|
Loading…
Reference in New Issue
Block a user