escapedCharacter(char, depth) {
    if (depth == 0) {
      return char;
    } else {
      var arr = 'amp;'.repeat(depth-1);
      return '&' + arr + this.CHARACTER_ESCAPING_MAP[char].slice(1);
    }
  }
/**
   * Calculate the correct encoding of a character that should be used given the
   * nesting depth of the window in the frame tree.
   *
   * @param {string} char The character that should be escaped.
   * @param {number} depth The nesting depth of the appropriate window in the
   *     frame tree.
   * @return {string} The correctly escaped string.
   */
Calculate the correct encoding of a character that should be used given the
nesting depth of the window in the frame tree.

@param {string} char The character that should be escaped.
@param {number} depth The nesting depth of the appropriate window in the
frame tree.
@return {string} The correctly escaped string.
Calculate the correct encoding of a character that should be used given the nesting depth of the window in the frame tree . @param { string } char The character that should be escaped . @param { number } depth The nesting depth of the appropriate window in the frame tree . @return { string } The correctly escaped string .
escapedCharacter(char, depth) {
    if (depth == 0) {
      return char;
    } else {
      var arr = 'amp;'.repeat(depth-1);
      return '&' + arr + this.CHARACTER_ESCAPING_MAP[char].slice(1);
    }
  }
escapedCharacter ( char , depth ) { if ( depth == 0 ) { return char ; } else { var arr = 'amp;' . repeat ( depth - 1 ) ; return '&' + arr + this . CHARACTER_ESCAPING_MAP [ char ] . slice ( 1 ) ; } }
Calculate the correct encoding of a character that should be used given the
 nesting depth of the window in the frame tree.
Calculate the correct encoding of a character that should be used given the nesting depth of the window in the frame tree .