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