]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-core): isBuiltInTag -> use makeMap instead of Set (#307)
authorJian Zhang <49894777+ZhangJian-3ti@users.noreply.github.com>
Wed, 16 Oct 2019 02:18:55 +0000 (10:18 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 16 Oct 2019 02:18:55 +0000 (22:18 -0400)
packages/runtime-core/src/component.ts

index 20328af9e27ccde7e55ed5269f38544badaca0c5..0b6da59c54577d21f4e3081d42298396c27dc5e2 100644 (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