Skip to content

Commit cf12d18

Browse files
ZhangJian-3tiyyx990803
authored andcommitted
refactor(runtime-core): isBuiltInTag -> use makeMap instead of Set (vuejs#307)
1 parent 11ea3d3 commit cf12d18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/runtime-core/src/component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import {
2222
NOOP,
2323
isArray,
2424
isObject,
25-
NO
25+
NO,
26+
makeMap
2627
} from '@vue/shared'
2728
import { SuspenseBoundary } from './suspense'
2829
import {
@@ -224,8 +225,7 @@ export const setCurrentInstance = (
224225
currentInstance = instance
225226
}
226227

227-
const BuiltInTagSet = new Set(['slot', 'component'])
228-
const isBuiltInTag = (tag: string) => BuiltInTagSet.has(tag)
228+
const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component')
229229

230230
export function validateComponentName(name: string, config: AppConfig) {
231231
const appIsNativeTag = config.isNativeTag || NO

0 commit comments

Comments
 (0)