File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
test/unit/features/options Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ if (process.env.NODE_ENV !== 'production') {
3636 }
3737
3838 strats . name = function ( parent , child , vm ) {
39- if ( vm ) {
39+ if ( vm && child ) {
4040 warn (
4141 'options "name" can only be used as a component definition option, ' +
4242 'not during instance creation.'
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import Vue from 'vue'
22
33describe ( 'Options name' , ( ) => {
44 it ( 'should warn when giving instance a name' , ( ) => {
5+ const Comp = Vue . component ( 'custom' , { name : 'custom' } )
6+ new Comp ( )
7+ expect ( `options "name" can only be used as a component definition option` ) . not . toHaveBeenWarned ( )
8+
59 new Vue ( {
610 name : 'SuperVue'
711 } ) . $mount ( )
8-
9- /* eslint-disable */
10- expect ( `options "name" can only be used as a component definition option, not during instance creation.` )
11- . toHaveBeenWarned ( )
12- /* eslint-enable */
12+ expect ( `options "name" can only be used as a component definition option` ) . toHaveBeenWarned ( )
1313 } )
1414
1515 it ( 'should contain itself in self components' , ( ) => {
You can’t perform that action at this time.
0 commit comments