0af4ffc7ace3761a02dfa296450eba0e574185feaef5ad6f5cae6f38e3ff5889b09fab6bb7750630fc0c36bcd62046988ec8366e25307a112d43826047912b 597 B

12345678910111213141516171819202122
  1. /* @flow */
  2. import { warn, extend, isPlainObject } from 'core/util/index'
  3. export function bindObjectListeners (data: any, value: any): VNodeData {
  4. if (value) {
  5. if (!isPlainObject(value)) {
  6. process.env.NODE_ENV !== 'production' && warn(
  7. 'v-on without argument expects an Object value',
  8. this
  9. )
  10. } else {
  11. const on = data.on = data.on ? extend({}, data.on) : {}
  12. for (const key in value) {
  13. const existing = on[key]
  14. const ours = value[key]
  15. on[key] = existing ? [].concat(existing, ours) : ours
  16. }
  17. }
  18. }
  19. return data
  20. }