ES6ify /gr-url-encoding-behavior/*

Bug: Issue 6179
Change-Id: I52761e224602ccd53da781de7633f0447ff8b2b3
This commit is contained in:
Kasper Nilsson
2017-05-14 18:11:29 -07:00
parent 7ecd5593f5
commit 50e9023658

View File

@@ -18,14 +18,14 @@ limitations under the License.
'use strict';
/** @polymerBehavior Gerrit.URLEncodingBehavior */
var URLEncodingBehavior = {
const URLEncodingBehavior = {
/**
* Pretty-encodes a URL. Double-encodes the string, and then replaces
* benevolent characters for legibility.
*/
encodeURL: function(url, replaceSlashes) {
encodeURL(url, replaceSlashes) {
// @see Issue 4255 regarding double-encoding.
var output = encodeURIComponent(encodeURIComponent(url));
let output = encodeURIComponent(encodeURIComponent(url));
// @see Issue 4577 regarding more readable URLs.
output = output.replace(/%253A/g, ':');
output = output.replace(/%2520/g, '+');