From: Jian Zhang <49894777+ZhangJian-3ti@users.noreply.github.com> Date: Wed, 16 Oct 2019 02:18:55 +0000 (+0800) Subject: refactor(runtime-core): isBuiltInTag -> use makeMap instead of Set (#307) X-Git-Tag: v3.0.0-alpha.0~412 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cf12d18b4bbd70d66cb4cc5e7da1536298344cc6;p=thirdparty%2Fvuejs%2Fcore.git refactor(runtime-core): isBuiltInTag -> use makeMap instead of Set (#307) --- diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index 20328af9e2..0b6da59c54 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -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