| 2815 | } |
| 2816 | |
| 2817 | function initMethods (vm, methods) { |
| 2818 | var props = vm.$options.props; |
| 2819 | for (var key in methods) { |
| 2820 | vm[key] = methods[key] == null ? noop : bind(methods[key], vm); |
| 2821 | if (process.env.NODE_ENV !== 'production') { |
| 2822 | if (methods[key] == null) { |
| 2823 | warn( |
| 2824 | "method \"" + key + "\" has an undefined value in the component definition. " + |
| 2825 | "Did you reference the function correctly?", |
| 2826 | vm |
| 2827 | ); |
| 2828 | } |
| 2829 | if (props && hasOwn(props, key)) { |
| 2830 | warn( |
| 2831 | ("method \"" + key + "\" has already been defined as a prop."), |
| 2832 | vm |
| 2833 | ); |
| 2834 | } |
| 2835 | } |
| 2836 | } |
| 2837 | } |
| 2838 | |
| 2839 | function initWatch (vm, watch) { |
| 2840 | for (var key in watch) { |