|
|
@@ -257,9 +257,9 @@ function initMethods (vm: Component, methods: Object) {
|
|
|
const props = vm.$options.props
|
|
|
for (const key in methods) {
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
|
- if (methods[key] == null) {
|
|
|
+ if (typeof methods[key] !== 'function') {
|
|
|
warn(
|
|
|
- `Method "${key}" has an undefined value in the component definition. ` +
|
|
|
+ `Method "${key}" has type "${typeof methods[key]}" in the component definition. ` +
|
|
|
`Did you reference the function correctly?`,
|
|
|
vm
|
|
|
)
|
|
|
@@ -277,7 +277,7 @@ function initMethods (vm: Component, methods: Object) {
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
- vm[key] = methods[key] == null ? noop : bind(methods[key], vm)
|
|
|
+ vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm)
|
|
|
}
|
|
|
}
|
|
|
|