(vm, methods)
| 4839 | } |
| 4840 | |
| 4841 | function initMethods (vm, methods) { |
| 4842 | var props = vm.$options.props; |
| 4843 | for (var key in methods) { |
| 4844 | { |
| 4845 | if (typeof methods[key] !== 'function') { |
| 4846 | warn( |
| 4847 | "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + |
| 4848 | "Did you reference the function correctly?", |
| 4849 | vm |
| 4850 | ); |
| 4851 | } |
| 4852 | if (props && hasOwn(props, key)) { |
| 4853 | warn( |
| 4854 | ("Method \"" + key + "\" has already been defined as a prop."), |
| 4855 | vm |
| 4856 | ); |
| 4857 | } |
| 4858 | if ((key in vm) && isReserved(key)) { |
| 4859 | warn( |
| 4860 | "Method \"" + key + "\" conflicts with an existing Vue instance method. " + |
| 4861 | "Avoid defining component methods that start with _ or $." |
| 4862 | ); |
| 4863 | } |
| 4864 | } |
| 4865 | vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); |
| 4866 | } |
| 4867 | } |
| 4868 | |
| 4869 | function initWatch (vm, watch) { |
| 4870 | for (var key in watch) { |
no test coverage detected