All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rwt.runtime.BrowserFixes.js Maven / Gradle / Ivy

/*******************************************************************************
 *  Copyright: 2004, 2014 1&1 Internet AG, Germany, http://www.1und1.de,
 *                        and EclipseSource
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *    1&1 Internet AG and others - original API and implementation
 *    EclipseSource - adaptation for the Eclipse Remote Application Platform
 ******************************************************************************/

if (!Error.prototype.toString || Error.prototype.toString() == "[object Error]")
{
  /**
   * Some browsers (e.g. Internet Explorer) do not support to stringify
   * error objects like other browsers usually do. This feature is added to
   * those browsers.
   *
   * @type member
   * @return {var} TODOC
   */
  Error.prototype.toString = function() {
    return this.message;
  };
}

if (!Array.prototype.indexOf)
{
  /**
   * Returns the first index at which a given element can be found in the array,
   * or -1 if it is not present. It compares searchElement to elements of the Array
   * using strict equality (the same method used by the ===, or
   * triple-equals, operator).
   *
   * Natively supported in Gecko since version 1.8.
   * http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:indexOf
   *
   * @type member
   * @param searchElement {var} Element to locate in the array.
   * @param fromIndex {Integer} The index at which to begin the search. Defaults to 0, i.e. the whole
   *         array will be searched. If the index is greater than or equal to the length of the array,
   *         -1 is returned, i.e. the array will not be searched. If negative, it is taken as the
   *         offset from the end of the array. Note that even when the index is negative, the array is still
   *         searched from front to back. If the calculated index is less than 0, the whole array will be searched.
   * @return {var} TODOC
   */
  Array.prototype.indexOf = function(searchElement, fromIndex)
  {
    if (fromIndex == null) {
      fromIndex = 0;
    } else if (fromIndex < 0) {
      fromIndex = Math.max(0, this.length + fromIndex);
    }

    for (var i=fromIndex; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy