<commit_before>'use strict'
var Base = require('../base')
var Event = require('./events').Data
var proto = Base.prototype
var set = proto.set
var addNewProperty = proto.addNewProperty

module.exports = function (observable) {
  var Observable = observable.Constructor
  observable.define({
    setValueInternal (val, event) {
      var oldVal = this._input
      this._input = val
      var valIsObservable = val instanceof Observable
      if (valIsObservable) {
        this._input = val.on('data', this, void 0, void 0, event)
        this.emit('reference', oldVal, event)
      }
      if (oldVal instanceof Observable) {
        oldVal.off('data', { base: this })
        if (!valIsObservable) {
          this.emit('reference', oldVal, event)
        }
      }
      this.emit('value', val, event)
      return this
    },
    set (val, event, nocontext, escape) {
      var trigger
      if (event === void 0) {
        trigger = true
        event = new Event()
      }
      var base = set.call(this, val, event, nocontext, escape)
      // maybe something with the g doc fucked up<commit_msg>temp hack for render / data binding<commit_after>'use strict'
var Base = require('../base')
var Event = require('./events').Data
var proto = Base.prototype
var set = proto.set
var addNewProperty = proto.addNewProperty

module.exports = function (observable) {
  var Observable = observable.Constructor
  observable.define({
    setValueInternal (val, event) {
      var oldVal = this._input
      this._input = val
      var valIsObservable = val instanceof Observable
      if (valIsObservable) {
        this._input = val.on('data', this, void 0, void 0, event)
        if (this.refext) {
          this.refext(oldVal) //dirty temp hack for element collection
        }
        this.emit('reference', oldVal, event)
      }
      if (oldVal instanceof Observable) {
        oldVal.off('data', { base: this })
        if (!valIsObservable) {
          if (this.refext) {
            this.refext(oldVal) //dirty temp hack for element collection
          }
          this.emit('reference', oldVal, event)
        }
      }
      this.emit('value', val, event)
      return this
    },
    set (val, event, nocontext, escape) {
      var trigger
      if (event === void 0) {
        trigger = true
        event = new Event()
      }
      var base = set.call(this, val, event, nocontext, escape)
      // maybe something with the g doc fucked up
{'fraction_non_alphanumeric': 0.11397058823529412, 'fraction_numerical': 0.0024509803921568627, 'mean_word_length': 2.3547945205479452, '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': '6235120', 'n_tokens_mistral': 705, 'n_tokens_neox': 700, 'n_words': 218}