File tree Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -194,25 +194,16 @@ const defaultStrat = function (parentVal: any, childVal: any): any {
194194}
195195
196196/**
197- * Make sure component options get converted to actual
198- * constructors.
197+ * Validate component names
199198 */
200- function normalizeComponents ( options : Object ) {
201- if ( options . components ) {
202- const components = options . components
203- const normalized = options . components = { }
204- let def
205- for ( const key in components ) {
206- const lower = key . toLowerCase ( )
207- if ( isBuiltInTag ( lower ) || config . isReservedTag ( lower ) ) {
208- process . env . NODE_ENV !== 'production' && warn (
209- 'Do not use built-in or reserved HTML elements as component ' +
210- 'id: ' + key
211- )
212- continue
213- }
214- def = components [ key ]
215- normalized [ key ] = isPlainObject ( def ) ? Vue . extend ( def ) : def
199+ function checkComponents ( options : Object ) {
200+ for ( const key in options . components ) {
201+ const lower = key . toLowerCase ( )
202+ if ( isBuiltInTag ( lower ) || config . isReservedTag ( lower ) ) {
203+ warn (
204+ 'Do not use built-in or reserved HTML elements as component ' +
205+ 'id: ' + key
206+ )
216207 }
217208 }
218209}
@@ -273,7 +264,9 @@ export function mergeOptions (
273264 child : Object ,
274265 vm ? : Component
275266) : Object {
276- normalizeComponents ( child )
267+ if ( process . env . NODE_ENV !== 'production' ) {
268+ checkComponents ( child )
269+ }
277270 normalizeProps ( child )
278271 normalizeDirectives ( child )
279272 const extendsFrom = child . extends
You can’t perform that action at this time.
0 commit comments