<commit_before>// Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//     You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//     See the License for the specific language governing permissions and
// limitations under the License.

(function(internal, testing) {

  function StylePropertyMap(styleObject) {
    this._styleObject = styleObject;
  }
  internal.inherit(StylePropertyMap, internal.StylePropertyMapReadOnly);

  StylePropertyMap.prototype.set = function(property, value) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }

    if (value instanceof Array) {
      throw new TypeError(
        'Setting a sequence of StyleValues is not implemented yet');
    }

    if (!value instanceof StyleValue) {
      throw new TypeError(
        'The value must be a StyleValue or sequence of StyleValues');
    }

    if (!cssPropertyDictionary.isValidInput(property, value)) {
      cssPropertyDictionary.throwInvalidInputError(property, value);
    }
    this._styleObject[property] = value.cssString;
  };

  StylePropertyMap.prototype.append = function(property, values) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }

    if (!cssPropertyDictionary.isListValuedProperty(property)) {
      throw new TypeError(property + ' does not support lists of styleValues');
    }

    if (values == null) {
      throw new TypeError('null cannot be appended to CSS propertys');
    }

    if (!(values instanceof Array)) {
      values = [values];
    }

    var cssAppendString = this._styleObject['animationIterationCount'];
    var valueSeparator = cssPropertyDictionary.getListValueSeparator(property);
    for (var i = 0; i < values.length; i++) {
      if (!cssPropertyDictionary.isValidInput(property, values[i])) {
        cssPropertyDictionary.throwInvalidInputError(property, values[i]);
      }
      if (cssAppendString == '') {
        cssAppendString += values[i].cssString;
        continue;
      }
      cssAppendString += valueSeparator + values[i].cssString;
    }
    return this._styleObject[property] = cssAppendString;
  };

  StylePropertyMap.prototype.delete = function(property) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }
    this._styleObject[property] = '';
  };

  StylePropertyMap.prototype.has = function(property) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }
    return !(this._styleObject[property] == '');
  };

  Element.prototype.styleMap = function() {
    return new StylePropertyMap(this.style);
  };

  internal.StylePropertyMap = StylePropertyMap;
  if (TYPED_OM_TESTING) {
    testing.StylePropertyMap = StylePropertyMap;
  }

})(typedOM.internal, typedOMTesting);
<commit_msg>removed a hard coded value in the append method This was an accedental addition and was hence removed and replaced with the correct value<commit_after>// Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//     You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//     See the License for the specific language governing permissions and
// limitations under the License.

(function(internal, testing) {

  function StylePropertyMap(styleObject) {
    this._styleObject = styleObject;
  }
  internal.inherit(StylePropertyMap, internal.StylePropertyMapReadOnly);

  StylePropertyMap.prototype.set = function(property, value) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }

    if (value instanceof Array) {
      throw new TypeError(
        'Setting a sequence of StyleValues is not implemented yet');
    }

    if (!value instanceof StyleValue) {
      throw new TypeError(
        'The value must be a StyleValue or sequence of StyleValues');
    }

    if (!cssPropertyDictionary.isValidInput(property, value)) {
      cssPropertyDictionary.throwInvalidInputError(property, value);
    }
    this._styleObject[property] = value.cssString;
  };

  StylePropertyMap.prototype.append = function(property, values) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }

    if (!cssPropertyDictionary.isListValuedProperty(property)) {
      throw new TypeError(property + ' does not support lists of styleValues');
    }

    if (values == null) {
      throw new TypeError('null cannot be appended to CSS propertys');
    }

    if (!(values instanceof Array)) {
      values = [values];
    }

    var cssAppendString = this._styleObject[property];
    var valueSeparator = cssPropertyDictionary.getListValueSeparator(property);
    for (var i = 0; i < values.length; i++) {
      if (!cssPropertyDictionary.isValidInput(property, values[i])) {
        cssPropertyDictionary.throwInvalidInputError(property, values[i]);
      }
      if (cssAppendString == '') {
        cssAppendString += values[i].cssString;
        continue;
      }
      cssAppendString += valueSeparator + values[i].cssString;
    }
    return this._styleObject[property] = cssAppendString;
  };

  StylePropertyMap.prototype.delete = function(property) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }
    this._styleObject[property] = '';
  };

  StylePropertyMap.prototype.has = function(property) {
    var cssPropertyDictionary = propertyDictionary();
    if (!cssPropertyDictionary.isSupportedProperty(property)) {
      throw new TypeError(property + ' is not a supported CSS property');
    }
    return !(this._styleObject[property] == '');
  };

  Element.prototype.styleMap = function() {
    return new StylePropertyMap(this.style);
  };

  internal.StylePropertyMap = StylePropertyMap;
  if (TYPED_OM_TESTING) {
    testing.StylePropertyMap = StylePropertyMap;
  }

})(typedOM.internal, typedOMTesting);

{'fraction_non_alphanumeric': 0.10001358880282647, 'fraction_numerical': 0.0024459845087647777, 'mean_word_length': 3.717948717948718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2612496', 'n_tokens_mistral': 1910, 'n_tokens_neox': 1879, 'n_words': 573}