escapedCharacterString(str, depth) {
    // Some escaping introduces '&' characters so we escape '&' first to prevent
    // escaping the '&' added by other escape substitutions.
    str = str.replace(/&/g, this.escapedCharacter('&', depth));
    for (var char in this.CHARACTER_ESCAPING_MAP) {
      if (char != '&') {
        var regExp = new RegExp(char, 'g');
        str = str.replace(regExp, this.escapedCharacter(char, depth));
      }
    }
    return str;
  }
/**
   * Returns the string that is passed as an argument with all characters in
   * |this.ESCAPED_CHARACTER_MAP| replaced with the correct character encoding
   * that should be used, given the nesting depth of the window in the frame
   * tree.
   *
   * @param {string} str The string that should have its characters escaped.
   * @param {number} depth The nesting depth of the appropriate window in the
   *     frame tree.
   * @return {string} The correctly escaped string.
   */
Returns the string that is passed as an argument with all characters in
|this.ESCAPED_CHARACTER_MAP| replaced with the correct character encoding
that should be used, given the nesting depth of the window in the frame
tree.

@param {string} str The string that should have its characters escaped.
@param {number} depth The nesting depth of the appropriate window in the
frame tree.
@return {string} The correctly escaped string.
Returns the string that is passed as an argument with all characters in |this . ESCAPED_CHARACTER_MAP| replaced with the correct character encoding that should be used given the nesting depth of the window in the frame tree . @param { string } str The string that should have its characters escaped . @param { number } depth The nesting depth of the appropriate window in the frame tree . @return { string } The correctly escaped string .
escapedCharacterString(str, depth) {
    str = str.replace(/&/g, this.escapedCharacter('&', depth));
    for (var char in this.CHARACTER_ESCAPING_MAP) {
      if (char != '&') {
        var regExp = new RegExp(char, 'g');
        str = str.replace(regExp, this.escapedCharacter(char, depth));
      }
    }
    return str;
  }
escapedCharacterString ( str , depth ) { str = str . replace ( / & / g , this . escapedCharacter ( '&' , depth ) ) ; for ( var char in this . CHARACTER_ESCAPING_MAP ) { if ( char != '&' ) { var regExp = new RegExp ( char , 'g' ) ; str = str . replace ( regExp , this . escapedCharacter ( char , depth ) ) ; } } return str ; }
Returns the string that is passed as an argument with all characters in
 |this.ESCAPED_CHARACTER_MAP| replaced with the correct character encoding
 that should be used, given the nesting depth of the window in the frame
 tree.
Returns the string that is passed as an argument with all characters in |this . ESCAPED_CHARACTER_MAP| replaced with the correct character encoding that should be used given the nesting depth of the window in the frame tree .
// Some escaping introduces '&' characters so we escape '&' first to prevent // escaping the '&' added by other escape substitutions.