<commit_before>/**
 * An **event** is an Emitter, the idea of this Object is give to the Elements class
 * the possibility to listen for elements events, like: click, drag, scroll etc.
 * @namespace Events
 */
'use strict'

var Event = require('vigour-js/lib/event')
var Emitter = require('./emitter')

exports.on = {
  ChildConstructor: new Emitter({
    define: {
      /**
       * Use noInstances:true to not update the object instances when the object change.
       * @type {bool}
       * @memberOf Events
       */
      key: {
        set (val) {
          var domEventCache = this.domEventCache
          if (!domEventCache[val]) {
            if (val === 'transform') {
              console.error('something fishy going on, why is this transform ending up in dom event?')
            }
            // let attach = val === 'scroll' ? window : document
            // attach.addEventListener(val, function (e) {
            window.addEventListener(val, function (e) {
              var node = e.target
              var base = node.base || findTarget(node)
              var firstTarget
              var event
              while (base) {
                let on = base._on
                if (on && on[val]) {
                  if (!firstTarget) {
                    firstTarget = base
                    event = new Event(base, val)
                  } else {
                    base.emit(val, e, event)
                  }
                }
                base = base.parent
              }
              if (firstTarget) {
                if (e.x === void 0) {
                  let touch = e.changedTouches
                  let ev = touch ? touch[0] : e
                  e.x = ev.clientX
                  e.y = ev.clientY
                }
                firstTarget.emit(val, e, event)
              }<commit_msg>fix transform property to not create dom event<commit_after>/**
 * An **event** is an Emitter, the idea of this Object is give to the Elements class
 * the possibility to listen for elements events, like: click, drag, scroll etc.
 * @namespace Events
 */
'use strict'

var Event = require('vigour-js/lib/event')
var Emitter = require('./emitter')

exports.on = {
  ChildConstructor: new Emitter({
    define: {
      /**
       * Use noInstances:true to not update the object instances when the object change.
       * @type {bool}
       * @memberOf Events
       */
      key: {
        set (val) {
          var domEventCache = this.domEventCache
          if (!domEventCache[val]) {
            // let attach = val === 'scroll' ? window : document
            // attach.addEventListener(val, function (e) {
            window.addEventListener(val, function (e) {
              var node = e.target
              var base = node.base || findTarget(node)
              var firstTarget
              var event
              while (base) {
                let on = base._on
                if (on && on[val]) {
                  if (!firstTarget) {
                    firstTarget = base
                    event = new Event(base, val)
                  } else {
                    base.emit(val, e, event)
                  }
                }
                base = base.parent
              }
              if (firstTarget) {
                if (e.x === void 0) {
                  let touch = e.changedTouches
                  let ev = touch ? touch[0] : e
                  e.x = ev.clientX
                  e.y = ev.clientY
                }
                firstTarget.emit(val, e, event)
              }
{'fraction_non_alphanumeric': 0.09969022810475922, 'fraction_numerical': 0.001126443255421008, 'mean_word_length': 1.288659793814433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '875487', 'n_tokens_mistral': 940, 'n_tokens_neox': 892, 'n_words': 291}