<commit_before>import { applyChangesFromDom } from './utils.js'

export default function extendYXmlFragment (Y, _document, _MutationObserver) {
  Y.requestModules(['Array']).then(function () {
    class YXmlFragment extends Y.Array.typeDefinition['class'] {
      constructor (os, _model, _content, args) {
        super(os, _model, _content)
        this.dom = null
        this._domObserver = null
        this._domObserverListener = null
      }

      insertDomElements () {
        return Y.Xml.typeDefinition.class.prototype.insertDomElements.apply(this, arguments)
      }

      bindToDom (dom) {
        if (this.dom != null || dom.__yxml != null) {
          throw new Error('Already bound to a dom element!')
        }
        if (_MutationObserver == null) {
          throw new Error('Not able to bind to a DOM element, because MutationObserver is not available!')<commit_msg>bugfix, use Y.XmlElement instead of Y.Xml<commit_after>import { applyChangesFromDom } from './utils.js'

export default function extendYXmlFragment (Y, _document, _MutationObserver) {
  Y.requestModules(['Array']).then(function () {
    class YXmlFragment extends Y.Array.typeDefinition['class'] {
      constructor (os, _model, _content, args) {
        super(os, _model, _content)
        this.dom = null
        this._domObserver = null
        this._domObserverListener = null
      }

      insertDomElements () {
        return Y.XmlElement.typeDefinition.class.prototype.insertDomElements.apply(this, arguments)
      }

      bindToDom (dom) {
        if (this.dom != null || dom.__yxml != null) {
          throw new Error('Already bound to a dom element!')
        }
        if (_MutationObserver == null) {
          throw new Error('Not able to bind to a DOM element, because MutationObserver is not available!')
{'fraction_non_alphanumeric': 0.10645339216767788, 'fraction_numerical': 0.0, 'mean_word_length': 2.892703862660944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6399376', 'n_tokens_mistral': 502, 'n_tokens_neox': 497, 'n_words': 138}