<commit_before>var registerElement = require('../vr-register-element');

var VRComponents = require('./components').components;
var VRNode = require('./vr-node');

module.exports = registerElement(
  'vr-mixin',
  {
    prototype: Object.create(
      VRNode.prototype,
      {
        attachedCallback: {
          value: function () {
            this.load();
          },
          writable: window.debug
        },

        setAttribute: {
          value: function (attr, value) {
            var component = VRComponents[attr];
            if (component && typeof value === 'object') {
              value = component.stringifyAttributes(value);
            }
            VRNode.prototype.setAttribute.call(this, attr, value);
          },
          writable: window.debug
        },

        getAttribute: {
          value: function (attr, defaultValue) {
            var component = VRComponents[attr];
            var value = VRNode.prototype.getAttribute.call(this, attr, defaultValue);
            if (!component || typeof value !== 'string') { return value; }
            return component.parseAttributesString(value);
          },
          writable: window.debug
        }
      }
    )
  }
);
<commit_msg>Removes remanents of old setAttribute API<commit_after>/* global HTMLElement */
var registerElement = require('../vr-register-element');

var VRComponents = require('./components').components;
var VRNode = require('./vr-node');

module.exports = registerElement(
  'vr-mixin',
  {
    prototype: Object.create(
      VRNode.prototype,
      {
        attachedCallback: {
          value: function () {
            this.load();
          },
          writable: window.debug
        },

        setAttribute: {
          value: function (attr, value) {
            var component = VRComponents[attr];
            if (component && typeof value === 'object') {
              value = component.stringifyAttributes(value);
            }
            HTMLElement.prototype.setAttribute.call(this, attr, value);
          },
          writable: window.debug
        },

        getAttribute: {
          value: function (attr) {
            var component = VRComponents[attr];
            var value = HTMLElement.prototype.getAttribute.call(this, attr);
            if (!component || typeof value !== 'string') { return value; }
            return component.parseAttributesString(value);
          },
          writable: window.debug
        }
      }
    )
  }
);

{'fraction_non_alphanumeric': 0.12192167945094873, 'fraction_numerical': 0.0, 'mean_word_length': 1.894859813084112, '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': '5284702', 'n_tokens_mistral': 635, 'n_tokens_neox': 627, 'n_words': 136}