@ -145,7 +145,7 @@ function initMethods (vm: Component) {
if (methods[key] != null) {
vm[key] = bind(methods[key], vm)
} else if (process.env.NODE_ENV !== 'production') {
warn(`The method ${key} on vue instance is undefined.`, vm)
warn(`Method "${key}" is undefined in options.`, vm)
}
@ -15,4 +15,13 @@ describe('Options methods', () => {
vm.plus()
expect(vm.a).toBe(2)
})
it('should warn undefined methods', () => {
new Vue({
methods: {
hello: undefined
expect(`Method "hello" is undefined in options`).toHaveBeenWarned()