Skip to content

Commit 32383e5

Browse files
committed
remove name option warning during instantiation
1 parent 4740597 commit 32383e5

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/core/util/options.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ if (process.env.NODE_ENV !== 'production') {
3434
}
3535
return defaultStrat(parent, child)
3636
}
37-
38-
strats.name = function (parent, child, vm) {
39-
if (vm && child) {
40-
warn(
41-
'options "name" can only be used as a component definition option, ' +
42-
'not during instance creation.'
43-
)
44-
}
45-
return defaultStrat(parent, child)
46-
}
4737
}
4838

4939
/**

test/unit/features/options/name.spec.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
import Vue from 'vue'
22

33
describe('Options name', () => {
4-
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-
9-
new Vue({
10-
name: 'SuperVue'
11-
}).$mount()
12-
expect(`options "name" can only be used as a component definition option`).toHaveBeenWarned()
13-
})
14-
154
it('should contain itself in self components', () => {
165
const vm = Vue.extend({
176
name: 'SuperVue'

0 commit comments

Comments
 (0)