old_contents: var utils    = require('../utils')
  
  /**
   *  Binding for event listeners
   */
  module.exports = {
  
      isFn: true,
  
      bind: function () {
          this.context = this.binding.isExp
              ? this.vm
              : this.binding.compiler.vm
          if (this.el.tagName === 'IFRAME' && this.arg !== 'load') {
              var self = this
              this.iframeBind = function () {
                  self.el.contentWindow.addEventListener(self.arg, self.handler)
              }
              this.el.addEventListener('load', this.iframeBind)
          }
      },
  
      update: function (handler) {
          if (typeof handler !== 'function') {
              utils.warn('Directive "v-on:' + this.expression + '" expects a method.')
              return
          }
          this.reset()
          var vm = this.vm,
              context = this.context
          this.handler = function (e) {
              e.targetVM = vm
              context.$event = e
              var res = handler.call(context, e)
              context.$event = null
              return res
          }
          if (this.iframeBind) {
              this.iframeBind()
          } else {
              this.el.addEventListener(this.arg, this.handler)
          }
      },
  
      reset: function () {
          var el = this.iframeBind
              ? this.el.contentWindow
              : this.el
          el.removeEventListener(this.arg, this.handler)
      },
  
      unbind: function () {
          this.reset()
          this.el.removeEventListener('load', this.iframeBind)
      }
  }
new_contents: var utils    = require('../utils')
  
  /**
   *  Binding for event listeners
   */
  module.exports = {
  
      isFn: true,
  
      bind: function () {
          this.context = this.binding.isExp
              ? this.vm
              : this.binding.compiler.vm
          if (this.el.tagName === 'IFRAME' && this.arg !== 'load') {
              var self = this
              this.iframeBind = function () {
                  self.el.contentWindow.addEventListener(self.arg, self.handler)
              }
              this.el.addEventListener('load', this.iframeBind)
          }
      },
  
      update: function (handler) {
          if (typeof handler !== 'function') {
              utils.warn('Directive "v-on:' + this.expression + '" expects a method.')
              return
          }
          this.reset()
          var vm = this.vm,
              context = this.context
          this.handler = function (e) {
              e.targetVM = vm
              context.$event = e
              var res = handler.call(context, e)
              context.$event = null
              return res
          }
          if (this.iframeBind) {
              this.iframeBind()
          } else {
              this.el.addEventListener(this.arg, this.handler)
          }
      },
  
      reset: function () {
          var el = this.iframeBind
              ? this.el.contentWindow
              : this.el
          if (this.handler) {
              el.removeEventListener(this.arg, this.handler)
          }
      },
  
      unbind: function () {
          this.reset()
          this.el.removeEventListener('load', this.iframeBind)
      }
  }
subject: check for handler presence in v-on reset (#366)