refactor(runtime-core): isBuiltInTag -> use makeMap instead of Set (#307)

This commit is contained in:
Jian Zhang 2019-10-16 10:18:55 +08:00 committed by Evan You
parent 11ea3d35d8
commit cf12d18b4b

View File

@ -22,7 +22,8 @@ import {
NOOP, NOOP,
isArray, isArray,
isObject, isObject,
NO NO,
makeMap
} from '@vue/shared' } from '@vue/shared'
import { SuspenseBoundary } from './suspense' import { SuspenseBoundary } from './suspense'
import { import {
@ -224,8 +225,7 @@ export const setCurrentInstance = (
currentInstance = instance currentInstance = instance
} }
const BuiltInTagSet = new Set(['slot', 'component']) const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component')
const isBuiltInTag = (tag: string) => BuiltInTagSet.has(tag)
export function validateComponentName(name: string, config: AppConfig) { export function validateComponentName(name: string, config: AppConfig) {
const appIsNativeTag = config.isNativeTag || NO const appIsNativeTag = config.isNativeTag || NO