From 3249069e6a84610c29ac74a92fe780d5423e7077 Mon Sep 17 00:00:00 2001 From: Scott Sauyet Date: Sun, 10 Sep 2023 14:51:04 -0400 Subject: [PATCH] Remove post-ES5 code --- boot/boot.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 05018d6cc..73d8f041f 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -294,10 +294,10 @@ for `+`) to a string */ $tw.utils.decodeTWURIList = function(s) { return $tw.utils.decodeURIComponentSafe( - s.split('&') - .map(function(s) {return s.replaceAll('+', ' ')}) - .map(function(s) {return s.includes(' ') ? '[[' + s + ']]' : s}) - .join( ' ') + s.split("&") + .map(function(s) {return s.replace(/\+/g, " ")}) + .map(function(s) {return s.indexOf(" ") >= 0 ? "[[" + s + "]]" : s}) + .join(" ") ) }; @@ -307,7 +307,7 @@ for `+`) to a string */ $tw.utils.decodeTWURITarget = function(s) { return $tw.utils.decodeURIComponentSafe( - s.replaceAll('+', ' ') + s.replace(/\+/g, " ") ) }; @@ -319,8 +319,8 @@ $tw.utils.encodeTWURIComponent = function(s) { .filter(Boolean) .map(function(s) {return s.trim()}) .map(function(s) {return encodeURIComponent(s)}) - .map(function(s) {return s.replaceAll('%20', '+')}) - .join('&') + .map(function(s) {return s.replace(/\%20/g, '+')}) + .join("&") }; /*